Loading ...
Sorry, an error occurred while loading the content.

[Clip] Neoplanet Channels to HTML

Expand Messages
  • Terry Robertson
    Hi experts! I ve been using NetTab Pro for about a year and I love it. Now it s about time I got down to making use of the power of the Clipbook! I often want
    Message 1 of 4 , Jun 24, 1999
    • 0 Attachment
      Hi experts!

      I've been using NetTab Pro for about a year and I love it. Now it's
      about time I got down to making use of the power of the Clipbook!

      I often want to run a macro (a Clip in this case) on a text file to
      extract certain details from it or to rearrange it. I know using a NTP
      Clipbook will make it possible to automate this sort of thing but I
      don't really know where to start.

      Anyway I've decided to have a go at writing a Clip to translate an
      exported Neoplanet Channel into an HTML file. The format of the
      exported file is quite simple, so it should be pretty easy.

      I've 'borrowed' a few lines of stuff from existing Clipbooks to reduce
      the (new) file down to the basics elements, but I need some
      guidance as to how to proceed from here.

      This is how the file which will become the HTML file looks at this
      point (just an extract):

      ~CH:New York Resources
      ~FO:Guides
      ~PN:NY Sidewalk
      ~PU:http://newyork.sidewalk.com/
      ~PN:CitySearch NYC
      ~PU:http://newyork.citysearch.com/
      ~PN:Papermag
      ~PU:http://www.papermag.com/guide/guide.html
      ~PN:Yahoo NY
      ~PU:http://ny.yahoo.com/

      "~CH:" indicates a top-level heading
      "~FO:" indicates a second-level heading (there are only two levels)
      "~PN:" comes before the description of a URL
      "~PU:" marks the URL to go with the description above

      There will be further second-level headings with their own
      description/URL contents as you work through the file.

      So, what I need is a looping routine which produces an HTML
      unsorted list for each second-level heading and which stops when it
      reaches the end of the file.

      Any help appreciated. :-)

      Regards

      Terry Robertson
      terry@...

      ------------------------------------------------------------------------

      eGroups.com home: http://www.egroups.com/group/ntb-clips
      http://www.egroups.com - Simplifying group communications
    • Jody
      Hi Terry, ... Better late than never - what took you so long. ... This is one of many ways to do it. It requires you make a copy of your original
      Message 2 of 4 , Jun 28, 1999
      • 0 Attachment
        Hi Terry,

        > I've been using NetTab Pro for about a year and I love it. Now
        > it's about time I got down to making use of the power of the
        > Clipbook!

        Better late than never - what took you so long. <bg>

        > I often want to run a macro (a Clip in this case) on a text
        > file to extract certain details from it or to rearrange it.

        This is one of many ways to do it. It requires you make a copy of
        your original manually, because it formats the document itself. I
        started to put it in a bunch of variables and appending, but saw
        that it was more work than what it was worth.

        Because of text being added to the file it is hard to determine
        if you are at the end of the document. The script will end when
        it does not find anymore "~PU:"'s. (OK, so the method stinks,
        but it should work. <g>) I only had what you gave to work with
        and assumed the rest of it would look the same with perhaps a
        different amount of links in them.

        You will need to edit the clip for the html format you want. You
        can certainly add the code for the bare page, save it, and go
        right into a launch. Later, once you get everything the way you
        like it you can just click the clip and go to lunch while it is
        formatted, saved and uploads using a Ws_Ftp commandline, closes
        the file and Ws_Ftp which ran in the background. :)

        You might want to put a ^%nl% in front of <H2>^%Line%</H2><BR>^%nl%
        in the first loop.

        H=NeoPlanet
        ^!SetHintInfo Formatting...
        ^!SetScreenUpdate Off
        ^!Jump 1

        :Loop1
        ^!Find "~CH:" S
        ^!IfError Loop2a
        ^!Toolbar Cut
        ^!Set %Line%=^$GetLine$
        ^!DeleteLine
        <H2>^%Line%</H2><BR>^%nl%
        ^!Goto Loop1

        :Loop2a
        ^!Jump 1
        :Loop2b
        ^!Find "~FO:" S
        ^!IfError Loop3a
        ^!ToolBar Cut
        ^!Set %Line%=^$GetLine$
        ^!DeleteLine
        <H3>^%Line%</H3><P>^%nl%^%nl%
        ^!Goto Loop2b

        :Loop3a
        ^!Jump 1
        :Loop3b
        ^!Find "~PN:" S
        ^!ToolBar Cut
        ^!Set %Description%=^$GetLine$
        ^!DeleteLine

        ^!Find "~PU:" S
        ^!IfError Jump1
        ^!ToolBar Cut
        ^!Set %Link%=^$GetLine$
        ^!DeleteLine
        <A HREF="^%Link%">^%Description%</A><BR>^%nl%
        ^!Goto Loop3b

        :Jump1
        ^!Jump 1


        >~CH:New York Resources
        >~FO:Guides
        >~PN:NY Sidewalk
        >~PU:http://newyork.sidewalk.com/
        >~PN:CitySearch NYC
        >~PU:http://newyork.citysearch.com/
        >~PN:Papermag
        >~PU:http://www.papermag.com/guide/guide.html
        >~PN:Yahoo NY
        >~PU:http://ny.yahoo.com/

        This was the output with two of the above pasted in a new doc,
        hence the duplicate:

        <H2>New York Resources</H2><BR>
        <H3>Guides</H3><P>

        <A HREF="http://newyork.sidewalk.com/">NY Sidewalk</A><BR>
        <A HREF="http://newyork.citysearch.com/">CitySearch NYC</A><BR>
        <A HREF="http://www.papermag.com/guide/guide.html">Papermag</A><BR>
        <A HREF="http://ny.yahoo.com/">Yahoo NY</A><BR>


        <H2>New York Resources</H2><BR>
        <H3>Guides</H3><P>

        <A HREF="http://newyork.sidewalk.com/">NY Sidewalk</A><BR>
        <A HREF="http://newyork.citysearch.com/">CitySearch NYC</A><BR>
        <A HREF="http://www.papermag.com/guide/guide.html">Papermag</A><BR>
        <A HREF="http://ny.yahoo.com/">Yahoo NY</A><BR>

        Happy NoteTabbin',
        Jody Adair

        The NoteTabbers Assistant Page
        http://www.sureword.com/notetab
        NoteTab Home Page - Go Pro.....
        http://www.notetab.com

        ------------------------------------------------------------------------

        eGroups.com home: http://www.egroups.com/group/ntb-clips
        http://www.egroups.com - Simplifying group communications
      • Terry Robertson
        ... Finding the time and inclination to get started . ;-) ... Thanks for your input Jody. I m going to study your method and see what I can learn from it. In
        Message 3 of 4 , Jun 30, 1999
        • 0 Attachment
          On 29 Jun 99, at 1:13, Jody wrote:

          > Better late than never - what took you so long. <bg>

          Finding the time and inclination to get started . ;-)

          > This is one of many ways to do it.

          Thanks for your input Jody. I'm going to study your method and see
          what I can learn from it.

          In fact, Charlie Raines has given me some big clues in email and I
          have now got this working just the way I want it. Thanks Charlie!

          The exercise has shown me (as if I hadn't realised) how useful
          Clips are. Now that I've written one or two Clips (OK mainly
          'borrowing' bits of other people's work and modifying it to suit) I
          shall certainly be doing more.

          I'll be lurking around here on a regular basis to pick up more tips. I
          know how brilliant you guys are, so you might get some more silly
          questions from me in the future! ;-)

          Regards

          Terry Robertson
          terry@...

          ------------------------------------------------------------------------

          eGroups.com home: http://www.egroups.com/group/ntb-clips
          http://www.egroups.com - Simplifying group communications
        • Jody
          Hi Terry, ... I am glad you got it working. I did not see the post answered so I replied. Normally I will send a private eMail to see if it was answered if
          Message 4 of 4 , Jun 30, 1999
          • 0 Attachment
            Hi Terry,

            > Thanks for your input Jody. I'm going to study your method and
            > see what I can learn from it.
            >
            > In fact, Charlie Raines has given me some big clues in email
            > and I have now got this working just the way I want it. Thanks
            > Charlie!

            I am glad you got it working. I did not see the post answered so
            I replied. Normally I will send a private eMail to see if it was
            answered if it sat in my inbox for awhile. I messed up this
            time. I must remember to do that to save time in the future.

            Happy NoteTabbin',
            Jody Adair

            The NoteTabbers Assistant Page
            http://www.sureword.com/notetab
            NoteTab Home Page - Go Pro.....
            http://www.notetab.com

            ------------------------------------------------------------------------

            eGroups.com home: http://www.egroups.com/group/ntb-clips
            http://www.egroups.com - Simplifying group communications
          Your message has been successfully submitted and would be delivered to recipients shortly.