Automating StumbleUpon submissions with AutoHotKey

automating StumbleUpon submissions

Automating StumbleUpon submissions

I had over 100 URLs I wanted to submit to StumbleUpon.com and wanted to tag them with around 12 interests. This would have taken me quite some to do manually so I wrote an AutoHotKey script to web scrape and cranked it out in no time!
Below is the video demonstrating the Automating StumbleUpon submissions.

And here is the first draft of my script  (I only included 3 urls in this example)

Interests:="Self Improvement|Gadgets|Technology|Internet|Computers|Internet Tools|Hacking|Software|Computer Science|Programming|Open Source|Computer Security|Web Development|IT|Windows"
urls=
(
Using built-in SciTE Find and Replace features- Great time savers!
AutoHotKey GUI menu for API web service- Connecting to SilverPop via API
Excellent SciTE editor video documenting powerful features
) ;***********Loop over StumbleUpon Submissions******************* Loop, parse, URLs, `n, `r ;loop over Var line by line { IfEqual, A_LoopField,,continue ;Skip loop if blank ;automating StumbleUpon submissions pwb := WBGet() pwb.Navigate("http://www.stumbleupon.com/submit") ;Navigate to URL while pwb.busy or pwb.ReadyState != 4 ;Wait for page to load Sleep, 100 ;~ pwb.document.all.url.Value :=A_LoopField ;Unique ID -no dashes Sleep, 400 Clipboard:=A_LoopField pwb.document.all.url.focus() pwb.document.ExecCommand("paste") ; paste pwb.document.all.nsfw[0].focus() ;~ pwb.document.all.nsfw[0].checked :=1 ;Set Tagname and Array value pwb.document.all.nsfw[0].Click() pwb.document.all.nsfw[0].fireEvent("onchange") Loop, parse, Interests, | ;loop over interests { DDL:=pwb.document.getElementByID("submit-search-interests-dropview").getElementsByClassName("droplist dropdown-menu")[0].getElementsByClassName("animated-item-view rendered animated-item-view-end") IfEqual, A_LoopField,,continue ;Skip loop if blank pwb.document.getElementByid("submit-search-interests").focus() ;~ pwb.document.getElementByid("submit-search-interests").value:=A_LoopField Clipboard:=A_Loopfield pwb.document.getElementByid("submit-search-interests").focus() pwb.document.ExecCommand("paste") ; paste - triggers DOM/javascript events WinActivate, StumbleUpon loop, % (ddl.length) { if (trim(DDL[A_index-1].innerTEXT) =A_LoopField){ ;~ MsgBox % trim(DDL[A_index-1].innerTEXT) Sleep, 500 pwb.document.getElementByid("submit-search-interests").focus() Sleep, 500 SendPlay, {Down} Sleep, 500 SendPlay, {Enter} } } } ;***********submit StumbleUpon submissions******************* sleep, 1000 pwb.document.getElementByID("submit-view-save").click() ;***********Cancel navigate away from page and just submit******************* WinWaitActive,Windows Internet Explorer WinActivate, Windows Internet Explorer ;~ https://autohotkey.com/board/topic/38243-fill-form-in-the-background-logging-into-account/ ControlClick,Button2,ahk_class #32770,The webpage you are viewing is trying to close the tab. Sleep, 1000 } ;End loop over pages MsgBox complete automating StumbleUpon submissions