Blog News
| Browse in : |
All
> Topics
> St.Ego's Blog
All > Topics > CMS Blog All > Topics > F.N.F.T. Any of these categories - All of these categories |
Auto-Playlist Publishing From Twitter Scraps
I recently started using Twitter, by proxy through Ivory Tower using an Articles publication type. But I only send Twitter the status update, whereas on Ivory Tower I publish my status as well as my mood and what I am listening to (both optional).
So I got the crazy idea to scrape the Ivory Tower status updates for an archive of what I was listening to. This would, essentially, be my playlist...
I thought that I would be able to complete the task in about 10 minutes by making a new base module template and calling the Articles API in it for a list of the entries that I wanted, then loop through them and output in the middle.
Another reason that I was doing this is because it seemed so stupidly simple that there was no reason that it should not exist on the site, so I set out to try and find one.
I failed. It really was stupidly simple, taking one new template file with four lines of uncomplicated template tags. I spent more time adding design than getting the data on the page. And it really did only take about 10 minutes to figure out and implement.
<xar:set name="articles">xarModAPIFunc('articles','user','getall',
array('ptid'=>19, 'where'=>"body ne ''"))</xar:set>
<xar:foreach in="$articles" value="$article">
#$article['body']#
</xar:foreach>
Just put the above into [yourtheme]/modules/base/user-main-userlist.xt. It really is that simple. You ask Articles for all items of that pubtype that have data, loop through it and output in the middle.
I <3 working with Xaraya...
There are no comments attached to this item. You must be registered and logged in to post comments!
- Options:
- View Article Map
- View Archives