Announcement

Collapse
No announcement yet.

Help with new WOTD script conversion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with new WOTD script conversion

    Well I really did it this time, I've been looking to replace the Yahoo RSS feed with something more stable. The family really liked how dictionary.com does theirs so I'm trying to convert to using that.

    I have most of it going, it's saying the word correctly, it's spelling the word nicely and while it speaks the definition it's not quite right and could be formatted much better.

    Todays word is limpid, and the definition comes out like

    DEFINITION: (adjective) Easily intelligible; clear.
    SYNONYMS: lucid, luculent, perspicuous, crystal clear, pellucid.
    USAGE: Her limpid writing style makes even the most convoluted topics seem simple and straightforward.
    Discuss

    What I'm wanting to do is split that definition into 4 parts. I'd like to break out those 4 parts into four separate strings so I can format the speaking better.

    word usage

    1 - adjective

    Defination

    2 - Easily intelligible; clear.

    Synonyms

    3 - lucid, luculent, perspicuous, crystal clear, pellucid.

    Usage

    4 - Her limpid writing style makes even the most convoluted topics seem simple and straightforward.

    and then cut off the "discuss" part that was meant to click on to get to a different part of dictionary.com.

    Now I realized days ago that I was way, way over my head but I've been reading and trying things, not that I really got anywhere and now think i'm going in the wrong direction.

    Since it's a lazy saturday maybe one or all of you scripting kind people would help me out. Let's think of it as a group project, what say?

    The script I'm trying to convert so far.

    PHP Code:
    Imports System.IO
    Imports System
    .Xml
        Sub Main
    (ByVal parm As Object)
            
    Dim m_xmld As XmlDocument
            
    'Dim m_node As XmlNode
            Dim Word As xmlNode
            Dim Deff As xmlNode
            Dim speakMsg As String = ""
            Dim I As Integer
            m_xmld = New XmlDocument
            m_xmld.Load("http://www.thefreedictionary.com/_/WoD/rss.aspx")
            Word = m_xmld.SelectSingleNode("rss/channel/item/title")
            Deff = m_xmld.SelectSingleNode("rss/channel/item/description")
            Dim Def As String = Deff.InnerText
            Dim arrayOfStrings() As String = Deff.InnerText.Split(CChar("."))
            speakMsg = speakMsg & ("Today'
    s word is, <silence msec='200'/>" & Word.InnerText & ".")
            speakMsg = speakMsg & ("
    <silence msec='800'/>")
            speakMsg = speakMsg & (Word.InnerText & "
    is spelled, <silence msec='200'/>")
            For I = 1 To Len(Word.InnerText)
                speakMsg = speakMsg & (UCase(Mid(Word.InnerText, I, 1))) & "
    , . " & "<silence msec='300'/>"
            Next
            speakMsg = speakMsg & ("
    <silence msec='500'/>")
            speakMsg = speakMsg & (Def)
            hs.Speak(speakMsg)
            speakMsg = Nothing
        End Sub 
    Marty
    ------
    XPpro SP3 /w HS Standard 2.5.0.80, HSTouch Server - 1.0.0.70, HSTouch Client 1.0.0.73 HSTouch Android - 1.0.0.2, HSTouch iPhone - 1.0.0.2
    Playing with HS3 a bit but it's just play at this point.

  • #2
    OK, how about just a hint then?

    I played and changed the script around some and these two lines

    Def = Split(Deff.InnerText,")")
    Def1 = Split(Deff.InnerText,".")

    I can get to speak everything to the left of the character in quotes. It's a start but can someone please show me how to get it to separate out everything between a range as opposed to just to the left. Something like below which of course doesn't work but hopefully someone gets the idea.

    Def = Split(Deff.InnerText,"(" - ")")
    Def1 = Split(Deff.InnerText,":" - ".")
    Marty
    ------
    XPpro SP3 /w HS Standard 2.5.0.80, HSTouch Server - 1.0.0.70, HSTouch Client 1.0.0.73 HSTouch Android - 1.0.0.2, HSTouch iPhone - 1.0.0.2
    Playing with HS3 a bit but it's just play at this point.

    Comment


    • #3
      I think I'm heading down the wrong path again. I think I need to do this with an array as opposed to what I'm trying?? At least I think so, I'm a bit bleary eyed from reading at the moment. I've been sitting here reading tutorials and trying different things for almost 24hrs straight. I need a nap.
      Marty
      ------
      XPpro SP3 /w HS Standard 2.5.0.80, HSTouch Server - 1.0.0.70, HSTouch Client 1.0.0.73 HSTouch Android - 1.0.0.2, HSTouch iPhone - 1.0.0.2
      Playing with HS3 a bit but it's just play at this point.

      Comment

      Working...
      X