document.Yowl.register( "twitter", [ "Found a Twitter account", "Twittered" ], [ "Found a Twitter account", "Twittered" ], "http://twitter.com/favicon.ico" ); document.Yowl.notify( "Found a Twitter account", "Loaded Twitter formatter", "Done", "twitter", null, false, 0 );
select: [ "twittername" ], where: [ { pattern: [ "?account", "http://xmlns.com/foaf/0.1/accountServiceHomepage", "http://www.twitter.com/" ] }, { pattern: [ "?account", "http://xmlns.com/foaf/0.1/accountName", "?twittername" ], setUserData: true } ] twitter-person
document.Yowl.notify( "Found a Twitter account", "Found Twitter account : " + ${twittername.content}, "Retrieving more information from Twitter API", "twitter", null, false, 0 );
url: 'http://www.twitter.com/statuses/user_timeline/' + ${twittername.content} + '.json', params: { callbackParamName: 'callback', count: '2' }
for (var i = 0; i != context.data.length; i++) { var item = context.data[i]; var uriStatus = "http://twitter.com/" + item.user.screen_name + "/statuses/" + item.id; var uriPerson = "http://twitter.com/" + item.user.screen_name; var sText = item.text.replace(/img(\@src)?\=([^\s]*)/g, "<img src=\'$2\' />"); sText = sText.replace(/tube(\@src)?\=(.*)/g, "<object width=\'425\' height=\'355\'><param name=\'movie\' value=\'$2\'/><param name=\'wmode\' value=\'transparent\'/><embed src=\'$2\' type=\'application/x-shockwave-flash\' wmode=\'transparent\' width=\'425\' height=\'355\'/></object>"); document.meta.store.insert([ { name: uriPerson, "$": uriStatus, "a": "<http://www.twitter.com/status>", "http://www.twitter.com/text": sText, "http://www.twitter.com/saidby": "<" + uriPerson + ">" } ]); /* * Add information about who said the status. */ document.meta.store.insert([ { name: uriPerson, "$": uriPerson, "http://xmlns.com/foaf/0.1/depiction": "<" + item.user.profile_image_url + ">", "http://xmlns.com/foaf/0.1/name": item.user.name } ]); }
select: [ "twitterer", "tweet", "name", "depiction" ], from: "http://twitter.com/${twittername}", where: [ { pattern: [ "?s", "a", "http://www.twitter.com/status" ] }, { pattern: [ "?s", "http://www.twitter.com/text", "?tweet" ] }, { pattern: [ "?s", "http://www.twitter.com/saidby", "?twitterer" ] }, { pattern: [ "?twitterer", "http://xmlns.com/foaf/0.1/name", "?name" ] }, { pattern: [ "?twitterer", "http://xmlns.com/foaf/0.1/depiction", "?depiction" ] } ]
if (${depiction} == undefined) ${depiction} = null; document.Yowl.notify( "Twittered", ${name.content} + " said:", ${tweet.content}, "twitter", ${depiction}, true, 0 );
${tweet}