user-pic

AS Docs -- Mayday! Mayday!

Vote 0 Votes

Going totally mad with the action stream docs and tags. I can't figure out what attributes MTStreamActionVar takes, for instance.

What I want do is this:

In a sidebar, list the last three to five streams from flickr amazon wishlist (can anyone do the amazon shopping list?) newsvine digg smugmug

or some combination of those.

I would like these ordered by stream -- all flickrs, then all amazons, etc.

The amazon shopping list would be a handy reminder of stuff piled up for later purchase (maxed out cards is one possible reason why you'd want to do this ...)

Anyone? Would be very, very grateful for help, pointers to documentation, something.

Reported on Movable Type 4.2

5 Replies

| Add a Reply
  • The MTStreamActionVar takes all sorts of input, and it all depends on the particular variables available for the stream and crashes out if you request a variable that isn't associated with the particular stream it is accessing!

    If you look at [this example](http://www.richardbenson.co.uk/2008/08/varying-display-of-action-stre.html), the second block of code contains an example of using MTStreamActionVar. I've had to put the call to MTSAV in an MT:if to top it from breaking. In that example steam uses a var called "description" but googlereader has an "annotation" field and not a "description" field. So asking for "description" on a googlereader action will cause a template error.

    As far as collecting all your streams by type, a modification of [this example](http://www.richardbenson.co.uk/2008/08/collating-action-streams.html) should do that, or maybe [Mark Pasc's Order plugin](http://markpasc.org/code/mt/order/) could do it (not used it yet myself).

  • Many thanks, Richard. But just to be clear: I should, therefore, have a look at the feeds from each of these services and see exactly what they're putting out? Is that the way you know whether to use "annotation" or "description"? I did see that very example, and tried that code. What I couldn't follow was when to use annotation and when to use description.

    I also can't figure out why the ASAmazon plugin, installed as instructed, won't pull a damn thing from my wishlist. I may have enemies, but not _that_ many ... :-)

    But honestly I can't believe that something so incredibly useful doesn't have easily accessible documentation.

  • The documentation looks like it's getting there, but isn't it more fun to play and break stuff anyway? :)

    The only way to know is to look in the perl for what fields it's extracting for each action. /plugins/ActionStreams/config.yaml contains most services, look from line 429 onwards and it's the last bit of code for each section that tells you the fields and field names that are being pulled out. e.g. goodreads:

    xpath:
    foreach: //item
    get:
    title: title/child::text()
    url: link/child::text()
    created_on: pubDate/child::text()
    modified_on: pubDate/child::text()
    by: author_name/child::text()

    That means you can reference "title", "url", "created_on", "modified_on" and "by" using MtStreamActionVar. I think "title" and "url" are the only ones you are guranteed to get in every stream.

    I would guess that the Amazon one isn't working as Amazon have updated their HTML, look at the plugin and look at the source of your wishlist page and see if you can find what the plugin is looking for.

  • I've made a list of all the fields the default action stream plugin pulls out, let me know if it's any help!

    [Action Stream field list](http://www.richardbenson.co.uk/2008/09/action-stream-field-list.html)

  • Oh boy! Brilliant stuff!

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

695 2910

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 567

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012