Twitter in Higher Ed Research

0 views
Skip to first unread message

Chris Craft

unread,
Mar 4, 2008, 5:43:39 PM3/4/08
to twitter-deve...@googlegroups.com
Hello!

I am a new member of this list and have been perusing the archives. I thought I'd ask a question, I hope that's ok!

I've been looking at different ways to get statistics from twitter, from twitter stats to tweeterboard, etc.

My goal is this...

I want to develop my own list of users that I am familiar with. Then, I want to pull every link they tweet over a certain period of time.

That's it! I want to analyze the links that are tweeted to see what patterns emerge.

Is this something that would be hard to do? What if I wanted to do this over a month's time? I do have shared hosting and plenty of MySQL databsed to spare if this helps.

Is this something that would be hard to code? Can you point me towards something that already does this that I might model?

Thanks so much for your help!

Chris Craft

John Krutsch

unread,
Mar 4, 2008, 10:04:36 PM3/4/08
to twitter-deve...@googlegroups.com
When you say "pull every link they tweet over" what do you mean?

John

JJ Merelo

unread,
Mar 5, 2008, 4:14:34 AM3/5/08
to twitter-deve...@googlegroups.com
I don't think that would be difficult, other than the fact that you'll have to transform the URL shorteners (tinyurl and suchlike) to their equivalents. Check out the blog entry on how to write a Twitter agent to start with, and write some code to extract URLs.

JJ

Chris Craft

unread,
Mar 5, 2008, 5:26:47 AM3/5/08
to twitter-deve...@googlegroups.com
I suppose what I'd like to do is have some sort of cron job running a script (that I'd code if I knew how) keeping a tally of every link tweeted and by whom. I am only concerned with users I define, not the whole community.

Chris

JJ Merelo

unread,
Mar 5, 2008, 5:56:47 AM3/5/08
to twitter-deve...@googlegroups.com


2008/3/5, Chris Craft <craf...@gmail.com>:
I suppose what I'd like to do is have some sort of cron job running a script (that I'd code if I knew how) keeping a tally of every link tweeted and by whom. I am only concerned with users I define, not the whole community.

Shouldn't be difficult to do using your favorite language. Perl has the just-upgraded Net::Twitter, for instance

JJ

Chris Craft

unread,
Mar 5, 2008, 6:05:43 AM3/5/08
to twitter-deve...@googlegroups.com
Probably not difficult for you, but I am quite new at programming, and know very little about Perl.

Hence my initial request, is there a script that already exists that I could modify or anything of the sort? I need a starting point and some hand-holding.

Chris

JJ Merelo

unread,
Mar 5, 2008, 6:24:42 AM3/5/08
to twitter-deve...@googlegroups.com
You could start here:

http://dev.twitter.com/2008/02/how-to-build-twitter-agent.html

But using a Jabber agent for tracking stuff is probably a bit too
much. As I said, Net::Twitter works quite well:
http://search.cpan.org/~cthom/Net-Twitter-1.08/lib/Net/Twitter.pm
And using it is just a matter of writing stuff like:
#!/usr/bin/perl

use Net::Twitter;

my $twit = Net::Twitter->new(username=>"myuser", password=>"mypass" );

$result = $twit->update("My current Status");

$twit->credentials("otheruser", "otherpass");

$result = $twit->update("Status for otheruser");

To obtain your followers' statuses, issue:
$twit->following()

Some examples and more stuff can be found at my Porralia library:
http://code.google.com/p/porralia/

If you need assistance, just email me. And if you want to do it in
another language, just look for a Twitter library, there are loads of
them.

Cheers

JJ

Dossy Shiobara

unread,
Mar 5, 2008, 8:41:39 AM3/5/08
to twitter-deve...@googlegroups.com
On 2008.03.05, Chris Craft <craf...@gmail.com> wrote:
> I suppose what I'd like to do is have some sort of cron job running a
> script (that I'd code if I knew how) keeping a tally of every link
> tweeted and by whom. I am only concerned with users I define, not the
> whole community.

What would be better is to implement a bot that connects to Twitter over
XMPP, that follows all the people you are interested in. This way, you
avoid having to poll the Twitter service and instead receive push
updates.

Yes, this is a lot more complicated, but is more resource-friendly on
the Twitter servers.

The best thing Twitter could do is participate in some sort of feed-mesh
pub-sub service over XMPP. Then, they could punt on trying to scale
these data mining applications to whomever runs the syndication servie.

(I might be interested in setting such a thing up, if the Twitter folks
are interested in collaborating on such a thing.)

-- Dossy

--
Dossy Shiobara | do...@panoptic.com | http://dossy.org/
Panoptic Computer Network | http://panoptic.com/
"He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

Reply all
Reply to author
Forward
0 new messages