Option Explicit
Private Sub Command4_Click()
'WebBrowser1.Navigate "https://mobile.twitter.com/logout"
'WebBrowser1.Navigate "https://mobile.twitter.com/iniciarsesion"
'WebBrowser1.Navigate "https://mobile.twitter.com/i/guest"
'WebBrowser1.Document.getelementbyid("logout_button").Click
'borra archivos,cookies,paswords,formularios,add-ons,historial en internet explorer 7'
Shell "Rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 4351", vbNormalFocus
End Sub
Private Sub Form_Load()
from1.caption="TweetBot V1.0"
'WebBrowser1.Navigate "https://mobile.twitter.com/compose/tweet"
WebBrowser1.Navigate "https://mobile.twitter.com/session/new"
'<meta http-equiv="X-UA-Compatible" content="chrome=1">
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Timer1.Enabled = True
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.Object) Then
'si se cargo el sitio habilitamos los botones y login.
Debug.Print "Se Cargo la pagina completamente..."
'verificamos en que sitio estamos: si login o tweet?
Text4.Text = WebBrowser1.Document.body.outerText
If Label3.Caption = Text5.Text Then
'Estamos en Inicio de Sesion.
Command1.Enabled = True
Text1.Enabled = False
Text2.Enabled = True
Text3.Enabled = True
Else
'Estamos en Tweet.
Text1.Enabled = True
Command2.Enabled = True
'Des-habilitamos login.
Command1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
End If
End If
'¡Inicia sesión en Twitter! Regístrate
End Sub
Private Sub Text4_Change()
Dim Palabras() As String
Palabras = Split(Text4.Text, "!")
Text5.Text = Palabras(0)
End Sub
Private Sub Text2_Change()
'Completamos el campo del usuario con el TextBox 2.
Do While WebBrowser1.Busy
Loop
WebBrowser1.Document.getelementbyid("session[username_or_email]").Value = Text2.Text
End Sub
Private Sub Text3_Change()
'Completamos el campo del password con el TextBox 3.
Do While WebBrowser1.Busy
Loop
WebBrowser1.Document.getelementbyid("session[password]").Value = Text3.Text
End Sub
Private Sub Command1_Click()
'Enviamos el formulario con el usuario y contraseña.
WebBrowser1.Document.getelementbyid("commit").Click
'WebBrowser1.Navigate "https://mobile.twitter.com/compose/tweet"
End Sub
Private Sub Text1_Click()
WebBrowser1.Navigate "https://mobile.twitter.com/compose/tweet"
End Sub
Private Sub Text1_Change()
'Completamos el campo del usuario con el TextBox 1.
Do While WebBrowser1.Busy
Loop
WebBrowser1.Document.All("tweet[text]").Value = Text1.Text
End Sub
Private Sub Command2_Click()
'Enviamos el tweet.
WebBrowser1.Document.getelementbyid("commit").Click
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
'visitamos el sitio tweet:
WebBrowser1.Navigate "https://mobile.twitter.com/compose/tweet"
Timer1.Enabled = False
End Sub