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

Doing Technorati queries from Manila templates

Expand Messages
  • tojarrett
    Hi guys: What BoingBoing has done with baking Technorati queries into its Movable Type template is pretty cool. I would love to be able to do the same on my
    Message 1 of 9 , Apr 13 9:57 AM
    • 0 Attachment
      Hi guys:

      What BoingBoing has done with baking Technorati queries into its
      Movable Type template is pretty cool. I would love to be able to do
      the same on my Manila weblog.

      The problem is that the permalink macro currently returns an anchor
      tag whose HREF is the permalink URL, wrapped around an image call.

      Is there a way to use the permalink macro with some other macro to
      get just the permalink URL?

      (Note: the reason I want the naked URL is so that I can append it to
      the Technorati query string. See this post on my blog for the
      discussion: http://www.jarretthousenorth.com/2004/04/13.html#a3476).

      Thanks
      Tim
      --
      Tim Jarrett
      http://www.jarretthousenorth.com/
    • Marc Barrot
      ... Tim, you would also need to encode the permalink url so that it may be safely appended to the component part of the Technoratio http get request. I ve
      Message 2 of 9 , Apr 20 8:08 AM
      • 0 Attachment
        --- In manila-dev@yahoogroups.com, "tojarrett" <toj8j@a...> wrote:
        > Is there a way to use the permalink macro with some other macro to
        > get just the permalink URL?

        Tim, you would also need to encode the permalink url so that it may be
        safely appended to the component part of the Technoratio http get request.

        I've found out how to solve the problem with Radio [1] but my
        knowledge of Manila is very limited:

        Where are the publishing templates stored ?
        What does the current permalink macro call look like ?
        What is the script responsible for rendering template level
        pseudo-macros ?

        Any help appreciated.

        Marc

        1: http://radio.weblogs.com/0104487/2004/04/20.html#a667
      • Marc Barrot
        Starting from Lawrence s new and much needed Manila Quick Start Guide [1], and a non working test copy of Manila, I m trying to answer my ... As far as I can
        Message 3 of 9 , Apr 21 10:15 AM
        • 0 Attachment
          Starting from Lawrence's new and much needed Manila Quick Start Guide
          [1], and a non working test copy of Manila, I'm trying to answer my
          own questions:

          --- In manila-dev@yahoogroups.com, "Marc Barrot" <marc@p...> wrote:
          > Where are the publishing templates stored ?

          As far as I can tell, in the 'manilaWebSites' table, in the subtable
          named after your site, there is a '#newsSite.newsItems' table with a
          'template' string that looks like a good candidate. I need
          confirmation of this since I cannot use my copy of Manila to publish
          anything.

          > What does the current permalink macro call look like ?

          I haven't found a {permalink} macro in the Manila Basic Macros page
          [2], though I suspect it may very well exist (in which case that page
          is in need of an update).

          I did find a {link} macro, the documentation [3] of which refers to
          another page, News Items Links [4], which in turn refers to an
          interesting {url} macro. This {url} macro seems to return more or less
          what we're looking for, that is the actual permalink url for a
          news item.

          Unfortunately, this {url} does not appear to be entity encoded, so
          including it in a Technorati http get request may not work as expected.

          In any event, it's worth trying to include the following tag in your
          news item template :

          <a href="http://www.technorati.com/cosmos/search.html?url={url}"
          title="technorati cosmos link" target="_blank">cosmos</a>

          I can't do it myself since my test version of Manila appears to suffer
          from installation problems, which are actually delaying a port of
          activeRenderer to Manila...

          > What is the script responsible for rendering template level
          > pseudo-macros ?

          I still don't know, and I wish somebody (Lawrence :-) could help me
          there.

          Marc


          1: http://frontier.userland.com/discuss/msgReader$13239
          2: http://macros.userland.com/basic/
          3: http://macros.userland.com/basic/link
          4: http://manilanewbies.userland.com/stories/storyReader$3643
        • Timothy Jarrett
          ... That s the template that is needed. It s editable from the NewsItem Prefs UI. ... The macros that are legal to use in the News Item Templates (which aren t
          Message 4 of 9 , Apr 22 7:04 PM
          • 0 Attachment
            >> Where are the publishing templates stored ?
            >
            > As far as I can tell, in the 'manilaWebSites' table, in the subtable
            > named after your site, there is a '#newsSite.newsItems' table with a
            > 'template' string that looks like a good candidate. I need
            > confirmation of this since I cannot use my copy of Manila to publish
            > anything.

            That's the template that is needed. It's editable from the NewsItem
            Prefs UI.
            >
            >> What does the current permalink macro call look like ?
            >
            > I haven't found a {permalink} macro in the Manila Basic Macros page
            > [2], though I suspect it may very well exist (in which case that page
            > is in need of an update).

            The macros that are legal to use in the News Item Templates (which
            aren't legal anywhere else) are not listed on that page. This has been
            part of my problem.

            There is a {permalink} macro that can be used in NewsItem templates.
            Like in Radio, it generates an unencoded permalink URL wrapped around a
            graphic.

            > I did find a {link} macro, the documentation [3] of which refers to
            > another page, News Items Links [4], which in turn refers to an
            > interesting {url} macro. This {url} macro seems to return more or less
            > what we're looking for, that is the actual permalink url for a
            > news item.

            That was the missing piece! I can't believe I didn't find it!

            > Unfortunately, this {url} does not appear to be entity encoded, so
            > including it in a Technorati http get request may not work as
            > expected....
            > In any event, it's worth trying to include the following tag in your
            > news item template :
            >
            > <a href="http://www.technorati.com/cosmos/search.html?url={url}"
            > title="technorati cosmos link" target="_blank">cosmos</a>

            It works, partly, at least for me. The lack of URL encoding may at
            some point be a problem and will almost certainly cause my page not to
            validate any more, but it works. (There is a string.urlEncode verb in
            Frontier, but it's not defined as safe to use in Manila either on
            UserLand's servers or on my ISP.)

            The problem is that it gets munged when my page is rendered to my
            static server. The pattern you provide above gets rendered like this:

            <a href="http://www.technorati.com/cosmos/search..html?url={url}"
            title="technorati cosmos link" target="_blank">cosmos</a>

            Note the extra . between search and the .html extension. This causes
            the link to fail to work, giving me the Technorati home page instead.

            I don't think, even with the {URL} macro, that this can be solved if
            one does not have access to make changes to the object database or
            cannot install a plugin on the server. I hope I'm wrong, because I can
            currently do neither.

            Thanks for the pointers, though.

            --Tim
            --
            Tim Jarrett
            toj8j@...
            http://www.jarretthousenorth.com


            [Non-text portions of this message have been removed]
          • Lawrence Lee
            I ll post a feature request to our bug tracking database to add a pseudo macro for an encoded permalink URL. This is done in: manilaSuite.news.formatNewsItem
            Message 5 of 9 , Apr 22 9:41 PM
            • 0 Attachment
              I'll post a feature request to our bug tracking database to add a
              pseudo macro for an encoded permalink URL.

              This is done in: manilaSuite.news.formatNewsItem

              Lawrence
            • Marc Barrot
              ... Thanks Lawrence. Tim, until the next update of Manila becomes available, try this: Open the Frontier application, then the manila.root window. Expand
              Message 6 of 9 , Apr 23 9:10 AM
              • 0 Attachment
                --- In manila-dev@yahoogroups.com, "Lawrence Lee" <tomalak@t...> wrote:
                > This is done in: manilaSuite.news.formatNewsItem

                Thanks Lawrence.

                Tim, until the next update of Manila becomes available, try this:

                Open the Frontier application, then the manila.root window.

                Expand manilaSuite.news and open the formatNewsItem script.

                Locate and expand the //fullItemUrl bundle.

                Add the following line at the end of the bundle's content:

                s = string.replaceAll (s, "{encodedPermalinkUrl}", string.urlEncode
                (fullItemUrl), false)

                Save the script and close the Frontier app window.

                Now modify your items template to insert this:

                <a
                href="http://www.technorati.com/cosmos/search.html?url={encodedPermalinkUrl}"
                title="technorati cosmos link" target="_blank">cosmos</a>

                Let me know how it turns out (and remember the modification to
                manilaSuite.news.formatNewsItem will be wiped out the next time
                Userland publish an update to this script. Hopefully Jake will
                use 'encodedPermalinkUrl' for the name of the new pseudo macro :-)

                HTH

                Marc
              • Jake Savin
                I ve done a pretty thorough review of this thread, and came to the conclusion that the correct thing to do is indeed to add a new macro for the news item
                Message 7 of 9 , Apr 27 11:36 PM
                • 0 Attachment
                  I've done a pretty thorough review of this thread, and came to the
                  conclusion that the correct thing to do is indeed to add a new macro
                  for the news item template, encodedPermalinkUrl. This will make it
                  possible to do the BoingBoing-like cosmos links, as well as other kinds
                  of links.

                  Normally I'd want to avoid introducing more macros when possible, but
                  in this case a quirk in the way Manila handles macro rendering with
                  news items made it impossible to avoid.

                  A slight correction, and a couple of additions to Marc's suggestions:

                  We're going to base encodedPermalinkUrl on
                  manilaSuite.news.formatNewsItem's permlinkUrl (a local variable),
                  rather than fullItemUrl (also a local), which was added in preparation
                  for a feature which hasn't yet been released. ;-)

                  The first addition is to manilaSuite.themes.getLegalMacrosForObject.
                  Basically you can't add the encodedPermalinkUrl macro to the news item
                  template until Manila understands that this is a legal (safe) macro --
                  at the moment it will be neutered. getLegalMacrosForObject is where the
                  change will be made to allow encodedPermalinkUrl to be added to your
                  news item templates.

                  The second addition is a new macro for the news item template, msgNum,
                  which is analogous to Radio's itemNum. This will get you the message
                  number of the discussion group message which contains a given news
                  item. This may make other kinds of links possible, especially within
                  the same site that contains the news item.

                  I've got these changes in testing here, and will send a set of parts to
                  the list for folks to try out, probably tomorrow. I'll also let the
                  Weblogger.com guys know when it's safe for them to install the changes.

                  -Jake

                  On Apr 23, 2004, at 11:10 AM, Marc Barrot wrote:

                  > --- In manila-dev@yahoogroups.com, "Lawrence Lee" <tomalak@t...> wrote:
                  >> This is done in: manilaSuite.news.formatNewsItem
                  >
                  > Thanks Lawrence.
                  >
                  > Tim, until the next update of Manila becomes available, try this:
                  >
                  > Open the Frontier application, then the manila.root window.
                  >
                  > Expand manilaSuite.news and open the formatNewsItem script.
                  >
                  > Locate and expand the //fullItemUrl bundle.
                  >
                  > Add the following line at the end of the bundle's content:
                  >
                  > s = string.replaceAll (s, "{encodedPermalinkUrl}", string.urlEncode
                  > (fullItemUrl), false)
                  >
                  > Save the script and close the Frontier app window.
                  >
                  > Now modify your items template to insert this:
                  >
                  > <a
                  > href="http://www.technorati.com/cosmos/search.html?
                  > url={encodedPermalinkUrl}"
                  > title="technorati cosmos link" target="_blank">cosmos</a>
                  >
                  > Let me know how it turns out (and remember the modification to
                  > manilaSuite.news.formatNewsItem will be wiped out the next time
                  > Userland publish an update to this script. Hopefully Jake will
                  > use 'encodedPermalinkUrl' for the name of the new pseudo macro :-)
                  >
                  > HTH
                  >
                  > Marc
                  >
                  >
                  >
                  > ------------------------ Yahoo! Groups Sponsor
                  > ---------------------~-->
                  > Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
                  > Printer at MyInks.com. Free s/h on orders $50 or more to the US &
                  > Canada.
                  > http://www.c1tracking.com/l.asp?cid=5511
                  > http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/IHFolB/TM
                  > ---------------------------------------------------------------------
                  > ~->
                  >
                  >
                  > Yahoo! Groups Links
                  >
                  >
                  >
                  >
                  >



                  .
                • Jake Savin
                  I ve done a pretty thorough review of this thread, and came to the conclusion that the correct thing to do is indeed to add a new macro for the news item
                  Message 8 of 9 , Apr 27 11:43 PM
                  • 0 Attachment
                    I've done a pretty thorough review of this thread, and came to the
                    conclusion that the correct thing to do is indeed to add a new macro
                    for the news item template, encodedPermalinkUrl. This will make it
                    possible to do the BoingBoing-like cosmos links, as well as other kinds
                    of links.

                    Normally I'd want to avoid introducing more macros when possible, but
                    in this case a quirk in the way Manila handles macro rendering with
                    news items made it impossible to avoid.

                    A slight correction, and a couple of additions to Marc's suggestions:

                    We're going to base encodedPermalinkUrl on
                    manilaSuite.news.formatNewsItem's permlinkUrl (a local variable),
                    rather than fullItemUrl (also a local), which was added in preparation
                    for a feature which hasn't yet been released. ;-)

                    The first addition is to manilaSuite.themes.getLegalMacrosForObject.
                    Basically you can't add the encodedPermalinkUrl macro to the news item
                    template until Manila understands that this is a legal (safe) macro --
                    at the moment it will be neutered. getLegalMacrosForObject is where the
                    change will be made to allow encodedPermalinkUrl to be added to your
                    news item templates.

                    The second addition is a new macro for the news item template, msgNum,
                    which is analogous to Radio's itemNum. This will get you the message
                    number of the discussion group message which contains a given news
                    item. This may make other kinds of links possible, especially within
                    the same site that contains the news item.

                    I've got these changes in testing here, and will send a set of parts to
                    the list for folks to try out, probably tomorrow. I'll also let the
                    Weblogger.com guys know when it's safe for them to install the changes.

                    -Jake

                    On Apr 23, 2004, at 11:10 AM, Marc Barrot wrote:

                    > --- In manila-dev@yahoogroups.com, "Lawrence Lee" <tomalak@t...> wrote:
                    >> This is done in: manilaSuite.news.formatNewsItem
                    >
                    > Thanks Lawrence.
                    >
                    > Tim, until the next update of Manila becomes available, try this:
                    >
                    > Open the Frontier application, then the manila.root window.
                    >
                    > Expand manilaSuite.news and open the formatNewsItem script.
                    >
                    > Locate and expand the //fullItemUrl bundle.
                    >
                    > Add the following line at the end of the bundle's content:
                    >
                    > s = string.replaceAll (s, "{encodedPermalinkUrl}", string.urlEncode
                    > (fullItemUrl), false)
                    >
                    > Save the script and close the Frontier app window.
                    >
                    > Now modify your items template to insert this:
                    >
                    > <a
                    > href="http://www.technorati.com/cosmos/search.html?
                    > url={encodedPermalinkUrl}"
                    > title="technorati cosmos link" target="_blank">cosmos</a>
                    >
                    > Let me know how it turns out (and remember the modification to
                    > manilaSuite.news.formatNewsItem will be wiped out the next time
                    > Userland publish an update to this script. Hopefully Jake will
                    > use 'encodedPermalinkUrl' for the name of the new pseudo macro :-)
                    >
                    > HTH
                    >
                    > Marc
                    >
                    >
                    >
                    > ------------------------ Yahoo! Groups Sponsor
                    > ---------------------~-->
                    > Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
                    > Printer at MyInks.com. Free s/h on orders $50 or more to the US &
                    > Canada.
                    > http://www.c1tracking.com/l.asp?cid=5511
                    > http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/IHFolB/TM
                    > ---------------------------------------------------------------------
                    > ~->
                    >
                    >
                    > Yahoo! Groups Links
                    >
                    >
                    >
                    >
                    >



                    .
                  • Marc Barrot
                    ... Great! Thanks Jake. Now, if I can get my own copy of Manila to work (its setup is a little unusual), I may be able to create an activeRenderer for Manila
                    Message 9 of 9 , Apr 28 7:18 AM
                    • 0 Attachment
                      --- In manila-dev@yahoogroups.com, Jake Savin <jake@u...> wrote:
                      > I've done a pretty thorough review of this thread, and came to the
                      > conclusion that the correct thing to do is indeed to add a new macro
                      > for the news item template, encodedPermalinkUrl.

                      Great! Thanks Jake.

                      Now, if I can get my own copy of Manila to work (its setup is a little
                      unusual), I may be able to create an activeRenderer for Manila
                      edition, with Jack and Georg's help. But that's another thread... :-)

                      Cheers

                      Marc
                    Your message has been successfully submitted and would be delivered to recipients shortly.