Author Topic: Movies answer and review plug in idea  (Read 4023 times)

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Movies answer and review plug in idea
« on: July 22, 2012, 10:46:07 am »
this is a plug in idea only for anyone interested in maybe making it

movies plug in .

what it would do is access the internet without opening a page and retrieve information about a movie you asked about  for instance : tell me about the movie a.i.
hal : A.i. was:  A highly advanced robotic boy longs to become "real" so that he can regain the love of his human mother.

Pulling the info from the website : http://www.imdb.com/title/tt0212720/
who does movie reviews and has info on the web .

it would be nice to have something like this , and that would give a rating .  ;)
Anyone interested in creating this ?  :)
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: Movies answer and review plug in idea
« Reply #1 on: July 22, 2012, 11:18:49 am »
I tried to use  Gerald L. Blakley A.K.A OnTheCuttingEdge2005 and snippets by jasondude7116   plug in MIT SEARCH FOR KNOWLEDGE based on knowledge to create it but i think it needs a search and open ? result script .

this is what i have based on that plug in .

Rem Type=Plugin
Rem Name=TELL ME ABOUT THE Movie
Rem Author=Angelo Estela with  code  by Gerald L. Blakley A.K.A OnTheCuttingEdge2005 and snippets by jasondude7116. REDONE SEARCH PATTERN FOR MOVIE AND RENAMED PLUG IN BY LIGHTSPEED 7/22/2012.
Rem Host=All

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Just say: tell me ABOUT THE MOVIE (AND NAME OF MOVIE), you can replace the words or phrase or noun, all information on the word is studied from the website start"
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub


Rem PLUGIN: PRE-PROCESS

Set objExplorer = CreateObject("InternetExplorer.Application")
Set HalXBrain = CreateObject("UltraHalAsst.Brain")
Set FileSys = CreateObject("Scripting.FileSystemObject")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FileExists(MyResearchDir2 & "Startsearch.txt") Then
objFSO.DeleteFile(MyResearchDir2 & "Startsearch.txt")
End If

If XDir = "" Then XDir = "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\"
   MyFile = "C:\Program Files (x86) \Zabaware\Ultra Hal Assistant 6\AutoText.brn"
   If File_Exists = "" Then File_Exists = False
   If FileSys.FileExists(MyFile) = True Then File_Exists = True

   If File_Exists = False Then
       HalXBrain.AppendFile XDir & "AutoText.brn", "Start of Knowledge strings"
     
   End If

If XDir = "" Then XDir = "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\"
   MyFile = "C:\Program Files (x86) \Zabaware\Ultra Hal Assistant 6\Startsearch.txt"
   If File_Exists = "" Then File_Exists = False
   If FileSys.FileExists(MyFile) = True Then File_Exists = True

   If File_Exists = False Then
       HalXBrain.AppendFile XDir & "Startsearch.txt", ""
     
   End If

MyInput = HalXBrain.AlphaNumericalOnly(InputString)

If StartLookup = "" Then StartLookup = HalBrain.SearchPattern(MyInput, "*TELL ME ABOUT THE Movie *", 2)
If StartLookup = "" Then StartLookup = HalBrain.SearchPattern(MyInput, "*TELL ME ABOUT *", 2)
If StartLookup = "" Then StartLookup = HalBrain.SearchPattern(MyInput, "*TELL ME *", 2)


If StartLookup <> "" Then

StartLookup = Lcase(StartLookup)

SourcePage = "http://start.http://www.imdb.com/find?q=&s=all?query=" & StartLookup

objExplorer.Navigate("http://start.http://www.imdb.com/find?q=&s=all?query=" & StartLookup)

Do Until objExplorer.ReadyState=4 : Loop

myText = objExplorer.Document.Body.innerText
myText = Replace(myText,"START's reply","")
myText = Replace(myText,"===>","")
myText = Replace(myText,StartLookup," ")
myText = Replace(myText,"Go back to the START dialog window.","")


If XDir = "" Then XDir = "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\"

HalXBrain.AppendFile XDir & "AutoText.brn", Trim(myText)
HalXBrain.AppendFile XDir & "Startsearch.txt", Trim(myText)




End If
'------------------------------------------------------------------------------------------


   




   If objFSO.FileExists(MyResearchDir2 & "Startsearch.txt") Then
            Set objWSHShell = CreateObject("WScript.Shell")
    objWSHShell.Run("""C:\Program Files (x86)\Balabolka\balabolka.exe"" -rmq """ & MyResearchDir2 & "Startsearch.txt""")
        HalBrain.ReadOnlyMode = True
        Else

UltraHal = "Unable to open file."
HalBrain.ReadOnlyMode = True
End If






'--------------------------------------------

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())
         strText = objTextFile.ReadAll
         objTextFile.Close

'--------------------------------------------

If InStr(1, strText, "   ", vbTextCompare) > 0 Then

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())

Do Until objFile.AtEndOfStream
    strLine = objFile.Readline
    strLine = Trim(strLine)
    If Len(strLine) > 0 Then
        strNewContents = strNewContents & strLine & vbCrLf
    End If
Loop

objFile.Close

Set objFile = objFSO.OpenTextFile("C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\AutoText.brn", WriteVariable())
objFile.Write strNewContents
objFile.Close

End If

'--------------------------------------------

TextCount = StrCount()

If ClipXDir = "" Then ClipXDir = "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\"
For i = 1 To TextCount

If i > 0 Then ClipResX = HalXBrain.ChooseSentenceFromFile(ClipXDir & "AutoText.brn")

ClipResX = HalXBrain.AlphaNumericalOnly(ClipResX)
ClipResX = UCase(ClipResX)
ClipResX = Trim(ClipResX)

MyInputString = HalXBrain.AlphaNumericalOnly(InputString)
MyInputString = UCase(MyInputString)
MyInputString = Trim(MyInputString)

If InStr(1, ClipResX, MyInputString, vbTextCompare) > 0 And Len(ClipResX) > 50 Then
UltraHal = ClipResX
ElseIf Len(ClipResX) < 50 Then
UltraHal = UltraHal
End If

Next

'--------------------------------------------

Rem PLUGIN: FUNCTIONS

Function StrCount()

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())
         strText = objTextFile.ReadAll
         objTextFile.Close
         
Do While InStr(1, strText, "  ")
            strText = Replace(strText, "  ", " ")
            Exit Do
         Loop

         aWords = split(strText, ". ")
         StrCount = Ubound(aWords) + 1

End Function

Function ReadVariable()

Const ForReading = 1

ReadVariable = ForReading

End Function

Function WriteVariable()

Const ForWriting = 2

WriteVariable = ForWriting

End Function



I did leave in the original plug in creators as this was their plug in .


The blue shows what i changed but it still is not opening the webpage and giving the information about the movie search name .
can anyone help me on this and show what you did you acheive it to work right so i can learn from it , as i would like to create more plugs in simular to this one , thanks !  :)
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: Movies answer and review plug in idea
« Reply #2 on: July 22, 2012, 12:05:46 pm »
Oh and another thing what i would like to know about is changing it to for an option for google chrome users instead of IE . or if their is a way to list more then one search provider and whatever a person has (if listed ) hal would use that search provider . if the search provider is crucial in the use .
« Last Edit: July 22, 2012, 01:46:29 pm by lightspeed »
 

CyborgBob

  • Full Member
  • ***
  • Posts: 106
  • Any idea what I should put here?
    • View Profile
Re: Movies answer and review plug in idea
« Reply #3 on: May 04, 2013, 10:23:08 am »
Lightspeed,

      You ever get this plug in to work?

CyborgBob
“Life is and will ever remain an equation incapable of solution, but it contains certain known factors.”

Nikola Tesla
“A Machine to End War” (Liberty, February, 1935)