The RSS for Twitter only gives the first page of Tweets from a person. I was considering going through each of my other six pages of tweets and manually adding them via the Create Content -> Activity Stream that I'm warned not to use manually but after digging through the code I saw that I would be missing out in all the other meta details such as which feed and format to use, etc.

So, I have eight total pages of Tweets I'd like to import into my Activity Stream - what would be the best way to import old data?

Comments

akalsey’s picture

Status: Active » Closed (fixed)

You can edit activtystream_twitter.module to increase the number of items that Activity Stream gets from Twitter.

Find the line that says...

<?php
  $user->feed = 'http://twitter.com/statuses/user_timeline/'. $user->userid .'.rss';
?>

and change it to...

<?php
  $user->feed = 'http://twitter.com/statuses/user_timeline/'. $user->userid .'.rss?count=200';
?>

Then run cron. The last 200 tweets will be imported. If you want more than that, edit the line again and add &page=2 to the end of that URL.

<?php
  $user->feed = 'http://twitter.com/statuses/user_timeline/'. $user->userid .'.rss?count=200&page=2';
?>

You can keep doing that until you've gotten all your tweets.

Make sure to change it back when you're done. You don't want your server fetching 200 items on every cron.

BakerQ’s picture

I was hoping that editing the URL was all that was needed - I just didn't know if the page numbers or the counts would go along well. THANK YOU!