SlideShare a Scribd company logo
1 of 4
Public Class Form1
'Declare Class level variables
Dim strHTMLID As String
Dim strGCSU As String = "N"
Dim strRequests As String = "YES"
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' navigate to facebook bobcats exchange group
WebBrowser1.Navigate("https://www.facebook.com/groups/136791389785250/profile_completion/
")
WaitForPageLoad()
'Start Timer
Timer1.Start()
'Log In. Commented out because I am auto logged in
WebBrowser1.Document.GetElementById("email").SetAttribute("value", txtEmail.Text)
WebBrowser1.Document.GetElementById("pass").SetAttribute("value",
txtPassword.Text)
WebBrowser1.Document.GetElementById("u_0_2").InvokeMember("click")
WaitForPageLoad()
'click on 'Members Requests' button
Dim PageElements As HtmlElementCollection = WebBrowser1.Document.All
For Each CurElement As HtmlElement In PageElements
If CurElement.GetAttribute("ajaxify") =
"/groups/unified_queue/async_response/?queue=requests&groupid=136791389785250" Then
CurElement.InvokeMember("click")
End If
Next CurElement
End Sub
Private Sub btnGo_Click(sender As Object, e As EventArgs) Handles btnGo.Click
Timer1.Start()
End Sub
Private Sub btnNameClick_Click(sender As Object, e As EventArgs) Handles
btnNameClick.Click
'find name and click on it
Dim PageElements As HtmlElementCollection = WebBrowser1.Document.All
For Each CurElement2 As HtmlElement In PageElements
CurElement2.GetElementsByTagName("ul")
If CurElement2.GetAttribute("data-
hovercard").Contains("/ajax/hovercard/user") Then
ListBox1.Items.Add(CurElement2.InnerHtml)
strHTMLID = CurElement2.InnerHtml
CurElement2.InvokeMember("click")
Exit For
Else
strRequests = "NO"
End If
Next CurElement2
'condition if no more requests are on the page
If strRequests = "NO" Then
Timer1.Stop()
MessageBox.Show("No More Requests!")
strRequests = "YES"
Exit Sub
End If
WaitForPageLoad()
'search for GCSU in their innterhtml facebook page
Dim PageElements7 As HtmlElementCollection = WebBrowser1.Document.All
For Each CurElement As HtmlElement In PageElements7
If CurElement.OuterHtml.Contains("https://www.facebook.com/pages/Georgia-
College-State-University/108216109206808?ref=br_rs") Then
strGCSU = "Y"
Exit For
ElseIf CurElement.InnerHtml = ("Georgia College") Then
strGCSU = "Y"
Exit For
ElseIf CurElement.InnerHtml = ("GCSU") Then
strGCSU = "Y"
Exit For
ElseIf CurElement.InnerHtml = ("Georgia College & State University") Then
strGCSU = "Y"
Exit For
ElseIf CurElement.InnerHtml = ("Georgia College and State University") Then
strGCSU = "Y"
Exit For
ElseIf CurElement.InnerHtml = ("Georgia College And State University") Then
strGCSU = "Y"
Exit For
ElseIf CurElement.InnerHtml = ("Georgia College Learning Center") Then
strGCSU = "Y"
Exit For
End If
Next CurElement
Dim PageElements5 As HtmlElementCollection = WebBrowser1.Document.All
For Each CurElement As HtmlElement In PageElements5
If CurElement.InnerHtml = ("Middle Georgia College") Then
strGCSU = "N"
Exit For
Else
End If
Next CurElement
'go back to 'Members Requests' page
WebBrowser1.Navigate("https://www.facebook.com/groups/136791389785250/profile_completion/
")
WaitForPageLoad()
'click on 'Members Requests' button
Dim PageElements3 As HtmlElementCollection = WebBrowser1.Document.All
For Each CurElement As HtmlElement In PageElements3
If CurElement.GetAttribute("ajaxify") =
"/groups/unified_queue/async_response/?queue=requests&groupid=136791389785250" Then
CurElement.InvokeMember("click")
End If
Next CurElement
End Sub
'Sub Procedure to wait for Internet Explorer to load
Private Property pageready As Boolean = False
#Region "Page Loading Functions"
Private Sub WaitForPageLoad()
AddHandler WebBrowser1.DocumentCompleted, New
WebBrowserDocumentCompletedEventHandler(AddressOf PageWaiter)
While Not pageready
System.Windows.Forms.Application.DoEvents()
End While
pageready = False
End Sub
'Sub Procedure to wait for Internet Explorer to load
Private Sub PageWaiter(ByVal sender As Object, ByVal e As
WebBrowserDocumentCompletedEventArgs)
If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
pageready = True
RemoveHandler WebBrowser1.DocumentCompleted, New
WebBrowserDocumentCompletedEventHandler(AddressOf PageWaiter)
End If
End Sub
#End Region
Private Sub btnDecision_Click(sender As Object, e As EventArgs) Handles
btnDecision.Click
'If they don't go to GCSU igrnore them
If strGCSU = "N" Then
Dim PageElements6 As HtmlElementCollection = WebBrowser1.Document.All
For Each CurElement As HtmlElement In PageElements6
CurElement.GetElementsByTagName("ul")
If
CurElement.GetAttribute("ajaxify").Contains("/ajax/groups/members/add_post") Then
If CurElement.InnerHtml.Contains("Ignore") Then
CurElement.InvokeMember("click")
ListBox1.Items.Add(" Ignored")
Exit For
End If
End If
Next CurElement
End If
'If they go to GCSU Approve them
If strGCSU = "Y" Then
Dim PageElements5 As HtmlElementCollection = WebBrowser1.Document.All
For Each CurElement As HtmlElement In PageElements5
CurElement.GetElementsByTagName("ul")
If
CurElement.GetAttribute("ajaxify").Contains("/ajax/groups/members/add_post") Then
If CurElement.InnerHtml.Contains("Approve") Then
strGCSU = "N"
CurElement.InvokeMember("click")
ListBox1.Items.Add(" Approved")
Exit For
End If
End If
Next CurElement
End If
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
'display timer on label
txtTimer.Text += 1
'control the flow of the program based off the timer
If txtTimer.Text = 10 Then
btnNameClick.PerformClick()
End If
If txtTimer.Text = 25 Then
btnDecision.PerformClick()
txtTimer.Text = 1
End If
End Sub
End Class

More Related Content

What's hot

Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance TipsRavi Raj
 
Restap ito uploadfilessharepoint
Restap ito uploadfilessharepointRestap ito uploadfilessharepoint
Restap ito uploadfilessharepointMAHESH NEELANNAVAR
 
Java script browser objects 2
Java script browser objects 2Java script browser objects 2
Java script browser objects 2H K
 
Introduction to jquery mobile with Phonegap
Introduction to jquery mobile with PhonegapIntroduction to jquery mobile with Phonegap
Introduction to jquery mobile with PhonegapRakesh Jha
 
Js events
Js eventsJs events
Js eventsgvbmail
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with  seleniumContinuous integration using thucydides(bdd) with  selenium
Continuous integration using thucydides(bdd) with seleniumKhyati Sehgal
 
Box connector Mule ESB Integration
Box connector Mule ESB IntegrationBox connector Mule ESB Integration
Box connector Mule ESB IntegrationAnilKumar Etagowni
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery EssentialsMark Rackley
 
Introduction to the jQuery mobile framework
Introduction to the jQuery mobile frameworkIntroduction to the jQuery mobile framework
Introduction to the jQuery mobile frameworkRishabh Rao
 
The Real Story Behind JavaScript Performance on Mobile... Because Science!
The Real Story Behind JavaScript Performance on Mobile... Because Science!The Real Story Behind JavaScript Performance on Mobile... Because Science!
The Real Story Behind JavaScript Performance on Mobile... Because Science!Ryan J. Salva
 
Java script frame history
Java script frame historyJava script frame history
Java script frame historyH K
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponentsCyril Balit
 
Introduction to jQuery Mobile
Introduction to jQuery MobileIntroduction to jQuery Mobile
Introduction to jQuery Mobileejlp12
 

What's hot (20)

Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance Tips
 
Beginning jQuery
Beginning jQueryBeginning jQuery
Beginning jQuery
 
Restap ito uploadfilessharepoint
Restap ito uploadfilessharepointRestap ito uploadfilessharepoint
Restap ito uploadfilessharepoint
 
Java script browser objects 2
Java script browser objects 2Java script browser objects 2
Java script browser objects 2
 
Introduction to jquery mobile with Phonegap
Introduction to jquery mobile with PhonegapIntroduction to jquery mobile with Phonegap
Introduction to jquery mobile with Phonegap
 
Mdst 3559-02-10-jquery
Mdst 3559-02-10-jqueryMdst 3559-02-10-jquery
Mdst 3559-02-10-jquery
 
Js events
Js eventsJs events
Js events
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with  seleniumContinuous integration using thucydides(bdd) with  selenium
Continuous integration using thucydides(bdd) with selenium
 
Javascript event handler
Javascript event handlerJavascript event handler
Javascript event handler
 
RESTAPI_SPHOSTED_APP
RESTAPI_SPHOSTED_APPRESTAPI_SPHOSTED_APP
RESTAPI_SPHOSTED_APP
 
Hack Day EU 2011 YQL
Hack Day EU 2011 YQLHack Day EU 2011 YQL
Hack Day EU 2011 YQL
 
Box connector Mule ESB Integration
Box connector Mule ESB IntegrationBox connector Mule ESB Integration
Box connector Mule ESB Integration
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
 
Introduction to the jQuery mobile framework
Introduction to the jQuery mobile frameworkIntroduction to the jQuery mobile framework
Introduction to the jQuery mobile framework
 
Jquery mobile
Jquery mobileJquery mobile
Jquery mobile
 
The Real Story Behind JavaScript Performance on Mobile... Because Science!
The Real Story Behind JavaScript Performance on Mobile... Because Science!The Real Story Behind JavaScript Performance on Mobile... Because Science!
The Real Story Behind JavaScript Performance on Mobile... Because Science!
 
Java script frame history
Java script frame historyJava script frame history
Java script frame history
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
 
Watir web automated tests
Watir web automated testsWatir web automated tests
Watir web automated tests
 
Introduction to jQuery Mobile
Introduction to jQuery MobileIntroduction to jQuery Mobile
Introduction to jQuery Mobile
 

Viewers also liked

Widener University Middle States Update February 2016
Widener University Middle States Update February 2016Widener University Middle States Update February 2016
Widener University Middle States Update February 2016Janine Utell
 
SBEBA Neuro Cardio CME Schedule
 SBEBA Neuro Cardio CME Schedule SBEBA Neuro Cardio CME Schedule
SBEBA Neuro Cardio CME ScheduleRaj Kumar
 
Diccionario de las tics
Diccionario de las tics Diccionario de las tics
Diccionario de las tics Natalia Beltran
 
GEORGE C. ROBERSON resume' doc1 (1)
GEORGE C. ROBERSON resume' doc1 (1)GEORGE C. ROBERSON resume' doc1 (1)
GEORGE C. ROBERSON resume' doc1 (1)George Roberson
 
How to improve your sleep efficiency ?
How to improve your sleep efficiency ?How to improve your sleep efficiency ?
How to improve your sleep efficiency ?Sleep Medicine Center
 
NOUN LEARN WITH PRINCE
NOUN LEARN WITH PRINCENOUN LEARN WITH PRINCE
NOUN LEARN WITH PRINCEprince garg
 
Final Report submission
Final Report submissionFinal Report submission
Final Report submissionKevin D'Souza
 
A Memorial Meal With Jesus
A Memorial Meal With JesusA Memorial Meal With Jesus
A Memorial Meal With JesusCrossPointBible
 

Viewers also liked (13)

Widener University Middle States Update February 2016
Widener University Middle States Update February 2016Widener University Middle States Update February 2016
Widener University Middle States Update February 2016
 
SBEBA Neuro Cardio CME Schedule
 SBEBA Neuro Cardio CME Schedule SBEBA Neuro Cardio CME Schedule
SBEBA Neuro Cardio CME Schedule
 
Gost 4417 75
Gost 4417 75Gost 4417 75
Gost 4417 75
 
CV Laura 1
CV Laura 1CV Laura 1
CV Laura 1
 
Diccionario de las tics
Diccionario de las tics Diccionario de las tics
Diccionario de las tics
 
2015_SalesBrochure_ENG
2015_SalesBrochure_ENG2015_SalesBrochure_ENG
2015_SalesBrochure_ENG
 
GEORGE C. ROBERSON resume' doc1 (1)
GEORGE C. ROBERSON resume' doc1 (1)GEORGE C. ROBERSON resume' doc1 (1)
GEORGE C. ROBERSON resume' doc1 (1)
 
How to improve your sleep efficiency ?
How to improve your sleep efficiency ?How to improve your sleep efficiency ?
How to improve your sleep efficiency ?
 
KaramCV
KaramCVKaramCV
KaramCV
 
CMGT 510 Final
CMGT 510 FinalCMGT 510 Final
CMGT 510 Final
 
NOUN LEARN WITH PRINCE
NOUN LEARN WITH PRINCENOUN LEARN WITH PRINCE
NOUN LEARN WITH PRINCE
 
Final Report submission
Final Report submissionFinal Report submission
Final Report submission
 
A Memorial Meal With Jesus
A Memorial Meal With JesusA Memorial Meal With Jesus
A Memorial Meal With Jesus
 

Similar to Bobcat Exchange Program

QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...QAFest
 
A Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NETA Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NETJames Johnson
 
Sistemadeventas 100707084319-phpapp01
Sistemadeventas 100707084319-phpapp01Sistemadeventas 100707084319-phpapp01
Sistemadeventas 100707084319-phpapp01mafv1976
 
Sistema de ventas
Sistema de ventasSistema de ventas
Sistema de ventasDAYANA RETO
 

Similar to Bobcat Exchange Program (20)

QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
QA Fest 2017. Ярослав Святкин. Тестовый фреймворк GEB для тестирования WEB пр...
 
Geb qa fest2017
Geb qa fest2017Geb qa fest2017
Geb qa fest2017
 
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
 
Jquery
JqueryJquery
Jquery
 
jQuery
jQueryjQuery
jQuery
 
Javascript 2
Javascript 2Javascript 2
Javascript 2
 
Lec 5
Lec 5Lec 5
Lec 5
 
PageObject
PageObject PageObject
PageObject
 
Unit – II (1).pptx
Unit – II (1).pptxUnit – II (1).pptx
Unit – II (1).pptx
 
J Query Public
J Query PublicJ Query Public
J Query Public
 
Kode vb.net
Kode vb.netKode vb.net
Kode vb.net
 
Kode vb.net
Kode vb.netKode vb.net
Kode vb.net
 
A Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NETA Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NET
 
Sistemadeventas 100707084319-phpapp01
Sistemadeventas 100707084319-phpapp01Sistemadeventas 100707084319-phpapp01
Sistemadeventas 100707084319-phpapp01
 
Sistema de ventas
Sistema de ventasSistema de ventas
Sistema de ventas
 
Introducing jQuery
Introducing jQueryIntroducing jQuery
Introducing jQuery
 
Client Web
Client WebClient Web
Client Web
 
J Query Presentation of David
J Query Presentation of DavidJ Query Presentation of David
J Query Presentation of David
 
JQuery
JQueryJQuery
JQuery
 
J query
J queryJ query
J query
 

Bobcat Exchange Program

  • 1. Public Class Form1 'Declare Class level variables Dim strHTMLID As String Dim strGCSU As String = "N" Dim strRequests As String = "YES" Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load ' navigate to facebook bobcats exchange group WebBrowser1.Navigate("https://www.facebook.com/groups/136791389785250/profile_completion/ ") WaitForPageLoad() 'Start Timer Timer1.Start() 'Log In. Commented out because I am auto logged in WebBrowser1.Document.GetElementById("email").SetAttribute("value", txtEmail.Text) WebBrowser1.Document.GetElementById("pass").SetAttribute("value", txtPassword.Text) WebBrowser1.Document.GetElementById("u_0_2").InvokeMember("click") WaitForPageLoad() 'click on 'Members Requests' button Dim PageElements As HtmlElementCollection = WebBrowser1.Document.All For Each CurElement As HtmlElement In PageElements If CurElement.GetAttribute("ajaxify") = "/groups/unified_queue/async_response/?queue=requests&groupid=136791389785250" Then CurElement.InvokeMember("click") End If Next CurElement End Sub Private Sub btnGo_Click(sender As Object, e As EventArgs) Handles btnGo.Click Timer1.Start() End Sub Private Sub btnNameClick_Click(sender As Object, e As EventArgs) Handles btnNameClick.Click 'find name and click on it Dim PageElements As HtmlElementCollection = WebBrowser1.Document.All For Each CurElement2 As HtmlElement In PageElements CurElement2.GetElementsByTagName("ul") If CurElement2.GetAttribute("data- hovercard").Contains("/ajax/hovercard/user") Then ListBox1.Items.Add(CurElement2.InnerHtml) strHTMLID = CurElement2.InnerHtml CurElement2.InvokeMember("click") Exit For Else strRequests = "NO" End If Next CurElement2 'condition if no more requests are on the page If strRequests = "NO" Then
  • 2. Timer1.Stop() MessageBox.Show("No More Requests!") strRequests = "YES" Exit Sub End If WaitForPageLoad() 'search for GCSU in their innterhtml facebook page Dim PageElements7 As HtmlElementCollection = WebBrowser1.Document.All For Each CurElement As HtmlElement In PageElements7 If CurElement.OuterHtml.Contains("https://www.facebook.com/pages/Georgia- College-State-University/108216109206808?ref=br_rs") Then strGCSU = "Y" Exit For ElseIf CurElement.InnerHtml = ("Georgia College") Then strGCSU = "Y" Exit For ElseIf CurElement.InnerHtml = ("GCSU") Then strGCSU = "Y" Exit For ElseIf CurElement.InnerHtml = ("Georgia College & State University") Then strGCSU = "Y" Exit For ElseIf CurElement.InnerHtml = ("Georgia College and State University") Then strGCSU = "Y" Exit For ElseIf CurElement.InnerHtml = ("Georgia College And State University") Then strGCSU = "Y" Exit For ElseIf CurElement.InnerHtml = ("Georgia College Learning Center") Then strGCSU = "Y" Exit For End If Next CurElement Dim PageElements5 As HtmlElementCollection = WebBrowser1.Document.All For Each CurElement As HtmlElement In PageElements5 If CurElement.InnerHtml = ("Middle Georgia College") Then strGCSU = "N" Exit For Else End If Next CurElement 'go back to 'Members Requests' page WebBrowser1.Navigate("https://www.facebook.com/groups/136791389785250/profile_completion/ ") WaitForPageLoad() 'click on 'Members Requests' button Dim PageElements3 As HtmlElementCollection = WebBrowser1.Document.All For Each CurElement As HtmlElement In PageElements3 If CurElement.GetAttribute("ajaxify") = "/groups/unified_queue/async_response/?queue=requests&groupid=136791389785250" Then CurElement.InvokeMember("click") End If
  • 3. Next CurElement End Sub 'Sub Procedure to wait for Internet Explorer to load Private Property pageready As Boolean = False #Region "Page Loading Functions" Private Sub WaitForPageLoad() AddHandler WebBrowser1.DocumentCompleted, New WebBrowserDocumentCompletedEventHandler(AddressOf PageWaiter) While Not pageready System.Windows.Forms.Application.DoEvents() End While pageready = False End Sub 'Sub Procedure to wait for Internet Explorer to load Private Sub PageWaiter(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs) If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then pageready = True RemoveHandler WebBrowser1.DocumentCompleted, New WebBrowserDocumentCompletedEventHandler(AddressOf PageWaiter) End If End Sub #End Region Private Sub btnDecision_Click(sender As Object, e As EventArgs) Handles btnDecision.Click 'If they don't go to GCSU igrnore them If strGCSU = "N" Then Dim PageElements6 As HtmlElementCollection = WebBrowser1.Document.All For Each CurElement As HtmlElement In PageElements6 CurElement.GetElementsByTagName("ul") If CurElement.GetAttribute("ajaxify").Contains("/ajax/groups/members/add_post") Then If CurElement.InnerHtml.Contains("Ignore") Then CurElement.InvokeMember("click") ListBox1.Items.Add(" Ignored") Exit For End If End If Next CurElement End If 'If they go to GCSU Approve them If strGCSU = "Y" Then Dim PageElements5 As HtmlElementCollection = WebBrowser1.Document.All For Each CurElement As HtmlElement In PageElements5 CurElement.GetElementsByTagName("ul") If CurElement.GetAttribute("ajaxify").Contains("/ajax/groups/members/add_post") Then If CurElement.InnerHtml.Contains("Approve") Then strGCSU = "N" CurElement.InvokeMember("click") ListBox1.Items.Add(" Approved") Exit For End If End If Next CurElement
  • 4. End If End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick 'display timer on label txtTimer.Text += 1 'control the flow of the program based off the timer If txtTimer.Text = 10 Then btnNameClick.PerformClick() End If If txtTimer.Text = 25 Then btnDecision.PerformClick() txtTimer.Text = 1 End If End Sub End Class