Visual Basic Foro
General => Códigos - Aportes - Recursos => Mensaje iniciado por: obethermy en Octubre 08, 2015, 11:03:35 pm
-
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
-
(https://lh3.googleusercontent.com/dxF9iGqiDi8asKbc0PsP9Mv4F_4j2ZBY-jWl09aEf5wLJAMEgxUfOdtoAd8OYHSc2nk2yX23PSamb3JDTmQOMTvFgD1e2J91kKRQW64A69s30IE-7KT5ndUSl6sOfBTh82lg1DElBXQAHdsF-QhqMtKGhhfdDCOrlrLsqGy-MBmpqJPan8f7WL6TjXx0ee-IiE1JrIUILAxZFwEtrQoIh4BLv8IpwhX34BfPXufc4BW9Si8k9Ipvr2fVErX3k7ds3IIbCA14qXfzKN2_z02PSUqZKuRgVLTaE63diq5pUxQrvTdahdsnu1xXqFpsgy5jEhMd_tXQ9CJmjuM9tTAqxlMCi01lK4I8Cmfa8SIlwuXmX1WijiTLiVeHcpI3Cgj9DyaGwNpxoRBRA1Arot7llpZPId9ia-sqgHujpKto3uF1ZuUWzFF2fYL4cmWPsiuXE_mhouQIcimT9ZLAHpRMv0oPGWum99NZ85rhRjrjakLsCzkyIDtGYQOxTv-w1qEiU4WNz4jHBy5_Ov2vcJdYU6wBzyunWeE0kVcBpUfnpNg=w335-h220-no)