Showing posts with label twitter. Show all posts
Showing posts with label twitter. Show all posts

Tuesday, October 20, 2009

Because the hand that feeds tastes good

Indeed!
Even when it's your own... But that's another story...
and here's Nine Inch Nails!!

And now for something completely different...

Twitter has been good to me, more or less. By providing a new platform for my largely nonsensical rants, twitter has been feeding followers and readers into the maw of my endless ambition, and on my end I have been mildly abusive to it. Not really, but pretending in that vein, I have mildly abused the twitter api to draw out and play with the vaguely relevant json data from my twitter feed and that of others.

What do I mean? Nothing really, I actually was going to write something quite meaningful today, but..

Anywho, these are some example twitter api calls:

http://twitter.com/statuses/[followers|friends|user_timeline]/[screen-name].[format (ie, xml, atom, json, etc.)]

in addition you can throw in GET arguments like page=# and count=# or callback=function for the json format in particular.

Thus to call the third page of therandshow twitter feed in json with 20 results per page and send it to a callback called karl do thus:

http://twitter.com/statuses/user_timeline/therandshow.json?count=20&page=3&callback=karl
(note: you must have already declared a function named karl to callback to, else the Karl's won't come home no matter how hard you call)

Now you might say to yourself: "Hey this seems vaguely useful, but how can I waste that usefulness while helping to strain twitter's resources until it's inevitable implosion?"

Glad you asked Jim, not so glad you asked Sally.

Here's a sample use (and let me credit jquery for making this example within the reach of my immense laziness), and by sample I mean something I did to kill time and decided to half-justify by putting onto the web - behold twitter results displayed by day!

Dun-dun-dun!!!


<html>
<head>
<title>Abusing Twitter Every Day</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
function twitterCallback2(twits) {
twittier = [{date:0,tweets:[]}];
j=0;

for(i=0; i < twits.length;i++) {
settable = new Date();
settable.setTime(Date.parse(twits[i].created_at));
if(twittier[j].date==0) {
twittier[j].date = settable;
twittier[j].tweets.push(twits[i]);
dte =Date(twittier[j].date);
}
else if(twittier[j].date.getDay()!=settable.getDay()) {
j++;
twittier.push({date:settable,tweets:[twits[i]]});
}
else {
twittier[j].tweets.push(twits[i]);
}
}
str="";
for(i=0; i < twittier.length;i++) {
str += "<div><h2>"+twittier[i].date+"</h2>";
for(j=0; j < twittier[i].tweets.length;j++) {
for(k in twittier[i].tweets[j]) {
if(k!='user') {
str+= "<p>"+k+" : "+twittier[i].tweets[j][k]+"</p>";
}
else {
/* if you want for some reason to also display the your own user object */
str+= "<p>"+k+" : "+twittier[i].tweets[j][k].toSource()+"</p>";

}
}
// str+= "<pre>"+twittier[i].tweets[j].toSource().replace(/,/g,",\n")+"</pre>";
}
str+= "</div>";
}
$("#holder").append(str);
}
</script>
</head>
<body>
<div id="holder">
</div>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/therandshow.json?count=100&page=1&callback=twitterCallback2"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/therandshow.json?count=100&page=2&callback=twitterCallback2"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/therandshow.json?count=100&page=3&callback=twitterCallback2"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/therandshow.json?count=100&page=4&callback=twitterCallback2"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/therandshow.json?count=100&page=5&callback=twitterCallback2"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/therandshow.json?count=100&page=6&callback=twitterCallback2"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/therandshow.json?count=100&page=7&callback=twitterCallback2"></script>
</body>
</html>



and so there it is. Rather random and vaguely cool, n'est pas? Just like my random evocation of my 3 years of middle school French.

So take it to your head, take it to your heart and remember Rand rocks. Goodnight Folks!

And God Bless.

Wednesday, July 22, 2009

Live and let doom

I must say Twitter has treated me very well. Although I still have questions about the format and about the ultimate viability of the business, it has been good to me, regularly bringing in far more readers than my actual blog.

But that fills me with a twinge of regret.

Originally the Twitter feed was a way to build views + get out my scattered thoughts, to build views and allow me to concentrate the most of my energies to big power-posts + crazy-zany posts + just general Rand-ish awesomeness.

Yet the oft-expected Second Renaissance did not arrive. Well, actually by now I'm on my third or forth Renaissance or so (though to be fair, may consider there to be several Renaissances, usually linked with the different streams of Classical knowledge coming in, ie, Irish monks 9th c., Sicilian/Spanish Muslims 11/12th c., Greek refugees + Italian loot 14th c., and so on.).

Perhaps, this goes back to an old lesson, taught to me time and time again, though most grossly during a period of stomach virus where I could not drink a full glass of water without throwing up.

When in a situation of where your opportunities are scarce, do as much as you can, whenever you can.

Big plans of an integrated social media strategy don't really fit into that space, as it refuses to realize the scarcity of time.

And while I RAND THE GREAT AND GLORIOUS! do refuse reality's dictates, I must on occasion play by its rules to subvert it, and time is often a rule I must bend to... so then...

So then as much as I can whenever I can. Thus Twittering, thus posting up sessions that might just be a paragraph or two. Thus trying to find time to write and draw and submit work to publication, even though I can't make a regular schedule of things just yet.

But one fine day...

Well, no, that isn't the proper sentiment. What I'm speaking of is not an acceptance of a life far less than what I want, and just trying to deal with it. If that were the case, wouldn't altering the life to be more like I want fit into the equation? No, this is an understanding that I am not where I want, but I have found a path that I think will get me there, but in the meantime I'm not inclined to play dead, nor to simply roar in frustration at the lack of steady order to my gains and losses. Rather, if I cannot yet conquer the world, I will conquer this and that, a country or two, and perhaps the city of Worms. And I will do good work while I'm at it, and I will put myself in a better position for grander dreams, or so I hope.

But in the end, all of that is still a bit of a means to an end, the happy note is that in the pursuit of that means, or rather in doing so in the correct way, I am in achievement of that end:

That is striving to be a servant of God, as best I can, whenever I can.

After all, that is the course of a holy fool.

So take it to your head, take it to your heart, and remember Rand rocks. Goodnight Folks!

And God Bless.

Monday, April 13, 2009

Twittering away the blues

That pun was sooo lame, soooo very, very, very lame. I mean it does draw attention to the fact that I'm now on twitter, but really now, twittering away the blues, I mean REALLY!

But while it might incline me toward various bad puns like this, twitter's mini-posting is a nice way to work out random thoughts and nice turns of phrases without stealing room and attention from my more valuable posts, and so on, and so on.

I'm glad I'm not going to actually use twitter to update my status, because essentially that's what I'm doing here and it is LAME!