Announcement

Collapse
No announcement yet.

Facebook plugin?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by mrhappy View Post
    sorry I don't use the script anymore so don't know why the error is coming up. It could be dependent on the notification, it might be coming up if someone is using quotes in posts and confusing it thinking the string has finished.

    That hstouch example means I had a screen in hstouch called scrFB. This screen had a single element tracked to the notification title. That script line meant when there was a new notification this screen showed up. It really depends on what you want to do in Hstouch.

    Comment


      #17
      Originally posted by mrhappy View Post
      sorry I don't use the script anymore so don't know why the error is coming up. It could be dependent on the notification, it might be coming up if someone is using quotes in posts and confusing it thinking the string has finished.

      That hstouch example means I had a screen in hstouch called scrFB. This screen had a single element tracked to the notification title. That script line meant when there was a new notification this screen showed up. It really depends on what you want to do in Hstouch.
      When I go in the HomeSeer log it says this after the error.

      Option Strict OffImports System.XMLImports System.Text.RegularExpressionsImports System.NetImports System.IOimports Schedulerimports SystemPublic Module scriptcode21#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin Public WithEvents hs As Scheduler.hsapplication Public WithEvents hsp As scheduler.hsp Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionSub Main(ByVal Parms As Object)Const LT As String = "Facebook Notification"Const DC As String = "Q8"Dim PRet As String = ""Dim XMLNews As New XmlDocumentDim XMLNewsNodeList As XmlNodeListDim XMLNewsNode As XmlNodeDim currentLine As StringDim data As StreamDim fileReader As New WebClient()Dim i As Integer = 0Dim sr As StreamReaderDim Result As String = ""TryfileReader.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705")data = fileReader.OpenRead("https://www.facebook.com/feeds/notifications.php?id=1400544417&viewer=1400544417&key=AWgvhd xJ8891DtBD&format=rss20")sr = New StreamReader(data)currentLine = sr.ReadLine()While Not (currentLine Is Nothing)If Not (currentLine.Trim().Equals("")) ThenPRet = PRet & currentLineEnd IfcurrentLine = sr.ReadLine()End Whiledata.Close()XMLNews.LoadXML(PRet)XMLNews.Save(hs.getapp path & "\data\facebook.xml")fileReader.Dispose()XMLNewsNodeList = XMLNews.SelectNodes("//item")'add the top five news items to the list box'remove all the values firstFor Each XMLNewsNode In XMLNewsNodeListDim regx As New Regex("", RegexOptions.IgnoreCase)Result = Regx.Replace(XMLNewsNode.Item("title").InnerText, " ")Result = Result.Replace(" ", " ")Result = Result.Replace(""", "")Result = Result.Replace(Chr(34), "")Result = Result.Replace(" : ", " ")Result = Result.TrimDim DStr = hs.devicestring(DC).TrimIf Result = DStr Then'hs.writelog(LT, "Device string is same as XML result, not a new notification")'this is not new newsElse'why does the device string not equal to the result'hs.writelog(LT, "Device String: " & hs.devicestring(DC))'hs.writelog(LT, "XML Result: " & Result)hs.writelog(LT, "New Notification: " & Result)hs.setdevicestring(DC, Result, True)hs.setdevicestring("Q9", XMLNewsNode.Item("title").InnerText, True)hs.setdevicestring("Q15", XMLNewsNode.Item("pubDate").InnerText, True)hs.setdevicestring("Q15", DateTime.Now.ToString("dd/MM/yyyy HH:mm"), True)hs.runex("xbmcmessage.vb","Main","New Facebook Notification")hs.speak("New Facebook Notification")hs.speak(Result)hs.plugin("HSTouch Server").ClientAction(70, "", "Facebook-L", "")End IFi = i+1If i = 1 ThenExit ForEnd IfNextCatch ex As Exceptionhs.writelog(LT, "Error: " & ex.Message)End TryEnd SubEnd Module

      Comment


        #18
        I think you might have an extra couple of spaces in that command, try

        hs.plugin("HSTouch Server").ClientAction(70, "", "Facebook-L", "")

        Comment


          #19
          Originally posted by mrhappy View Post
          I think you might have an extra couple of spaces in that command, try

          hs.plugin("HSTouch Server").ClientAction(70, "", "Facebook-L", "")

          ok, it works, thank you very much

          Comment


            #20
            Hello, can someone get this script HS3?

            Great script, it would be very boring.

            thank you

            Comment


              #21
              I don't think there is much work involved in converting it as all the codes are .net. The issue will be setting devices and calling hstouch, there are changes there..personally I'm not upgrading anytime soon to hs3 so I won't know what is involved but someone might give you an idea.

              Comment


                #22
                Originally posted by Loup View Post
                Hello, can someone get this script HS3?

                Great script, it would be very boring.

                thank you
                In a complete U turn I have now written it for HS3, only a few changes were needed and please follow the instructions at the top to get it working

                Link is at the bottom of the post here http://ajstillman12.wordpress.com/20...notifications/

                Comment

                Working...
                X