Author Topic: Web Super Scraper Complete using DOM. With a Twist.  (Read 111 times)

cyberjedi

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Web Super Scraper Complete using DOM. With a Twist.
« on: May 12, 2017, 07:36:16 am »
Rem Type=Plugin
Rem Name= localnews
Rem Author= cyberjedi
Rem Host=All

'-----------------------------------------------------------------
'This sub sets up the plug-ins option panel in Hal's options dialog
'-----------------------------------------------------------------

Sub OptionsPanel()
lblPlugin(0).Caption = ""
lblPlugin(0).Move 120, 120, 3300, 1200
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub

Rem PLUGIN: PLUGINAREA7


HalBrain.ReadOnlyMode = False
'Determines that you are talking about the weather
GetW = HalBrain.TopicSearch(UserName, "UserWeather")
If InStr(1,OriginalSentence, "weather",1) And Len(GetW) > 2 Then
 GetResponse = GetForecast(UserName)
ElseIf InStr(1,OriginalSentence, "weather",1) And Len(GetW) < 2 Then
End If


 ' This bad boy is a Scraper with a twist, All the data Scraped is ported through Hals Voice.  It took cyberjedi to pull it off. Enjoy. 
    ' This also Breaks Hals speech limitations on how much he can say. 
 ' Trigger= weather. This is for my news and weather, but has many uses. Just point it where you want. Change key word.
  'Working example https://www.youtube.com/watch?v=ugnohzxD4Hg   
   'I put this together while listening to this. -->>>https://www.youtube.com/watch?v=aqXW57WM9TA
  'Follow me in to the jungle. http://vaughnlive.tv/mrelectric
 ' I give myself about a 6.5 on cool ideas here


Rem PLUGIN: FUNCTIONS
Function GetForecast(UserName)

Const SVSFlagsAsync = 1
Const DontShowWindow = 0
Const WaitUntilFinished = 1
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Sapi = CreateObject("SAPI.SpVoice")
   For Each Voice In Sapi.GetVoices
       i = i + 1
   Next
For loopvar = 0 to i-1
if loopvar = CInt(confirm_voice) then
Set Sapi.Voice = Sapi.GetVoices.Item(loopvar)
end if
Next
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
HalMenu.HalCommand "<SPEAK>" & "Reading headlines !" & "</SPEAK>"
For loopvar = 0 to 2
If tempconfirm = loopvar then
if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines" & "</SPEAK>"
else if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Okay ." & "</SPEAK>"
wscript.quit
else
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines " & "</SPEAK>"
end if
end if
xmlDoc.async = false
xmlDoc.load("http://www.tampabay.com/rss/news/?tags=breaking-news") ' This is where u put you own rss feed .xml
Set nodelist = xmlDoc.selectNodes("rss/channel/item")
i = 3
For Each item In nodelist
Set f1 = item.selectsinglenode("title")
Set f2 = item.selectsinglenode("description")
HalMenu.HalCommand "<SPEAK>" & f1.text & "</SPEAK>"  ' these two lines are the Magic of the plugin
HalMenu.HalCommand "<SPEAK>" & f2.text & "</SPEAK>"  ' these two lines are the Magic of the plugin
i = i + 1
if i = tempconfirm then
wscript.Quit
end if
Next
end if
Next
End Function
« Last Edit: May 17, 2017, 01:37:18 am by cyberjedi »

Calhoone

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Web Super Scraper Complete using DOM. With a Twist.
« Reply #1 on: May 13, 2017, 02:25:19 am »
Nice work Cyber!! Thanks for all your hard work
 

LiFeTimeGamer

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • LifeTimeGamer
Re: Web Super Scraper Complete using DOM. With a Twist.
« Reply #2 on: May 13, 2017, 09:31:37 am »
For now I just want my HAL to make the morning coffee, you got a Plugin for that cyber????

Hahahaha  Just kidding.... GREAT WORK MAN!!!!!!
If the Code ain't broke your not trying hard enough.

cyberjedi

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Re: Web Super Scraper Complete using DOM. With a Twist.
« Reply #3 on: May 13, 2017, 02:57:39 pm »
LTG : lol

Yes i do, using a Macro and a coffee pot plugged into a Heavy duty X-10 Module.
Only works when the Ibm software is running though

Not worth the hassle, but just a great example of Hal off the Rails


bestwishes
cyberjedi