On: 2010/09/21 Viewed: 11214 times
Shorter URL for this page: http://ozh.in/tq

Current version : 2.0 – compatible with Twitter's OAuth API

If you want to browse your own tweet history, Twitter sucks. If you have published more than 3200 tweets, Twitter lost the older ones. If you want to search a particular tweet about that awesome link you shared, you're toast. You can use #hashtags in your tweets but they won't be of any use to help you organize them. Oh, and those horrible t.co links.

On the other hand, WordPress does all this fine, so I made a plugin to archive all your tweets in WordPress, easily search them, and everything you wish Twitter would do.

Live Example

My tweet archive: Ozh' Tweets (notice the cool stats in the sidebar)

Download

Download the plugin :
ozh-tweet-archiver.zip
Extract and upload to your blog, preserving directory structure.

Plugin Usage

  • Install a fresh new empty blog (a subdirectory of your current blog will be fine, or a tweet.domain.com subdomain, it doesn't matter)
  • Install, activate the plugin, follow configuration instructions.

Features, Plugin Configuration

You'll need to create a Twitter application to obtain the consumer and secret keys. That'll be the hardest part.

screenshot-1

FAQ

Q: The [whatever] does not work!
A: WorksForMe.

Q: But [Other guy's plugin] does the same and more!
A: Exactly. "And more". I didn't need this.

Q: How are tweets imported?
A: As regular posts, with a few post custom fields (containing tweet source, "in reply to" data, etc). Hashtags can be converted as post tags if you wish (you'll want to do this), t.co links can be expanded to their original URLs, and some proper markup will be applied (see below, developer info)

Q: I tried to import all my tweets for the first time but the page died with an error / timeout / alien abduction !!1
A: Just hit F5 to reload the page. There will be no duplicates.

Q: I have more than 3200 tweets. How do I import & archive the old ones?
A: You can't. Or you write a custom importer using my plugin functions as a start, download your entire archive from your Twitter profile, and do something with that.

Q: What theme did you use for your Tweet archive?
A: A modified version of Stopdesign's to use some features of my plugin. It's available in this SVN repository (probably don't expect any update) or as this zip file: ozh-tweet-archive-theme. No support or anything on this, this is for example only.

Q: Can you add this or that feature?
A: This plugin was made to fit my needs. But hey, who knows, maybe I'll feel the need for your idea? Head to the Github repository and file a pull request.

Q: That one tweet got weirdly formatted/truncated when imported!
A: There's an "Edit post" link somewhere. That's the beauty of WordPress when compared to Twitter.

Q: Something doesn't work
A: Create a file named debug.log in this plugin's directory. This will activate the debug mode and a lot of things will be logged in that file. See if that helps.

Theme developer stuff

Each tweet will be added some markup and classes, depending on your settings (if you want to link to @mentions, link to #hashtags as tags, etc…) to allow fine styling.

@mentions

When linked to Twitter profiles:

  1. <span class="username username_linked">@<a href="https://twitter.com/ozh" title="Ozh Richard">ozh</a></span>

Not linked:

  1. <span title="@ozh" class="username username_unlinked">@ozh</span>

#hashtags

You can elect to link hashtags to Twitter (as Twitter does), as local WordPress tags (much cooler), or to not link them. In each case, the markup for #bleh will be:

When linked to Twitter:

  1. <span class="hashtag hashtag_twitter">#<a href="https://twitter.com/search?q=#bleh">bleh</a></span>

When locally linked to WordPress tags:

  1. <span class="hashtag hashtag_local">#<a href="http://yoursite.com/tag/bleh">bleh</a>

Not linked:

  1. <span class="hashtag hashtag_no">#bleh</span>

Links

Links can be "un-t.co'd" (expanded)

  1. <a href="http://example.com" title="http://example.com" class="link link_untco">example.com</a>

Or kept as original t.co links:

  1. <a href="http://t.co/L4m3l1nk" class="link link_tco">http://t.co/L4m3l1nk</a>

Embedded media

If you enable embedding images from pic.twitter.com, you'll get the following:

  1. <span class="embed_image embed_image_yes"><a href="[image link]"><img src="[image src]" /></a></span>

Shorter URL

Want to share or tweet this page? Please use this short URL: http://ozh.in/tq

Metastuff

This page "Ozh’ Tweet Archiver (Backup Twitter With WordPress)" was posted on 21/09/2010 at 11:12 pm
Watch this discussion : Comments RSS 2.0.

93 Blablas

    Pages: « 1 [2] Show All

  1. 51
    TwisterMc United States »
    said, on 18/Jun/12 at 3:52 am # :

    We need to figure out how to get this to work with the new WordPress 3.4 Twitter shortcode.

  2. 52
    Rachelle Canada »
    said, on 19/Aug/12 at 11:07 pm # :

    Hi Ozh,
    Love this plugin, however, I may have found a bug.
    I have your Tweet Archiver installed on my main site…no problems. Everything works perfectly. Then I installed it on a subdirectory: /news on the same site.

    Everything works perfectly EXCEPT the Link #hashtags setting. If I set it to: 'Yes, pointing to Twitter search' it interferes with the 'More Tag' in posts. If I add a 'more tag' it displays on home page as: '#more-24″ class="more-link">More' instead of the word 'More' with hyperlink. If I set Link #hashtags to 'no' the More Tag works as it's supposed to.

    I have the same version of WordPress 3.4.1, same theme Grido, and same plugins on both the main site and subdirectory site.

    Any idea why this is happening?
    Thank you!

  3. 53
    Ozh »
    thought, on 26/Aug/12 at 8:50 am # :

    Rachelle » "more tag" within posts that are less than 140 characters? Kidding, right?

  4. 54
    Rachelle Canada »
    replied, on 26/Aug/12 at 7:57 pm # :

    Hahaha… not on Tweet posts.
    I wanted a plugin where I could archive all my tweets as private posts but also publish the pertinent ones as blog posts. Twitter Tools, quite frankly, sux and doesn't archive the way your plugin does.
    I'm using a customized version of the Grido theme, so on the homepage I have Tweet posts mixed with blog posts/articles etc in a tumblog/pinterest style. The "more tag" is on the lengthy blog posts.

    Anyway, when I saw your reply this morning, I realized there was one more thing I didn't try. I had created a child theme for my blog and added the plugin in to the child theme. So, this morning I removed it from the child theme, added it to the parent theme et voila! the "more tag" issue disappeared.

    Have no idea what the problem was. I know enough php to make minor changes or additions but not enough to solve all problems. There must be a directory issue with my child theme and your plugin… but anyway, it's working again now… that's all that matters! :)

    On a side note: Will your plugin continue to work with the new Twitter API changes? Cheers!

  5. 55
    jiva United States »
    commented, on 30/Aug/12 at 4:41 pm # :

    Brilliant plugin. Looking forward to using it more! Thanks again for sharing.

  6. 56
    jiva United States »
    commented, on 05/Sep/12 at 3:47 pm # :

    Hi, had a quick question on using #'s. My setting is to convert #'s into wordpress tags; however, when the tag is clicked in the wordpress post the url points to /tag/%post_tag%/ for all tags (resulting in no posts found). Do you have any suggestions to how I can fix this?

  7. 57
    Ozh »
    commented, on 05/Sep/12 at 4:40 pm # :

    jiva » indeed, that's a bug, I didn't notice that. I'll check and fix when I have some time

  8. 58
    Jiva United States »
    commented, on 08/Sep/12 at 9:55 pm # :

    Thanks Ozh, great plugin otherwise. Looking forward to the update when you have some time!

    Cheers

  9. 59
    Mark C United States »
    thought, on 24/Sep/12 at 3:09 pm # :

    I've noticed that the "new" RTs are not being archived. Here's a diff that I think should work.

    https://gist.github.com/3775868

  10. 60
    TwisterMc United States »
    commented, on 16/Dec/12 at 8:10 am # :

    It took a bit of digging, but I made this plugin 100x better in my opinion.

    I modified the import script to save the tweet id, then used WordPress' embed code to embed the Twitter URL into the post.

    Now instead of text, I get tweets with images and interactivity!

    Example: http://goo.gl/kQJEo

    My code may not be prefect (as my username is hard coded) but you can see what I changed here: http://pastebin.com/LACne6hB

  11. 61
    Ozh »
    wrote, on 16/Dec/12 at 7:16 pm # :

    TwisterMc » Thanks for sharing. Not something I'd use but it may interest others, thanks for sharing

  12. 62
    Aldo Italy »
    thought, on 20/Dec/12 at 5:39 pm # :

    Hi all,
    for those having the "%post_tag%" issue, you can fix it editing a very little piece of the plugin.

    Open the ozh-ta.php file and change the line 165 from this:

    1. $link = str_replace( '%tag%', $tag, $link );

    into this:

    1. $link = str_replace( '%post_tag%', $tag, $link );

    Hope this help and thanks to Ozh for sharing this plugin.

  13. 63
    Jiva United States »
    replied, on 20/Dec/12 at 6:40 pm # :

    Thanks Aldo! This helped me!

  14. 64
    iair1234 Argentina »
    wrote, on 21/Dec/12 at 5:12 am # :

    Hi. Your plugin is great, got a site running my twitter backup in 30 minutes.

    Then, are you changing twitter connection to allow authorization? because twitter is dropping public rss support and I guess this plugin will break then.

    Thank you!

  15. 65
    Ozh »
    wrote, on 21/Dec/12 at 8:49 am # :

    iair1234 » we'll see. Twitter is a gigantic pain in the ass with its API.

  16. 66
    WPStuffs India »
    replied, on 27/Dec/12 at 12:35 pm # :

    Thanks Ozh I have created my own Tweet blog with the help of your plugin…here it is – http://vivek.techiestuffs.com/tweets/

    Thanks again

  17. 67
    iair1234@gmail.com Argentina »
    wrote, on 04/Feb/13 at 5:27 pm # :

    Hi again, finally twitter will be breaking rss support on March 5th,

    I've found code to possibly add OAUTH support to your plugin:

    http://stackoverflow.com/questions/12916539/simplest-php-example-retrieving-user-timeline-with-twitter-api-version-1-1

    Your plugin is the only one doing this great task of archiving tweets in our own database, thus allowing real RSS!

    Thank you!

  18. 68
    Jiva United States »
    thought, on 28/Mar/13 at 12:16 am # :

    Just wanted to check in… is this plugin still working/supported? Mine seemed to stop updating in Mid March. I was going to uninstall/reinstall the plugin, but cannot find it via the Twitter "add a plugin" page…

  19. 69
    Ozh France »
    thought, on 28/Mar/13 at 8:01 am # :

    Jiva » Still working? http://planetozh.com/tweets/ yep. Supported? "Worksforme". Existing? http://wordpress.org/extend/plugins/ozh-tweet-archiver/ yep.

  20. 70
    oriste Cyprus »
    thought, on 28/Mar/13 at 11:12 am # :

    @Jiva Still works perfectly for me. See it at oriste.gr

  21. 71
    Jiva United States »
    thought, on 31/Mar/13 at 5:43 am # :

    Your right, it still works. Sorry for the false alarm – I disabled and reneabled it a few times and it started working again. Must have been my server or a conflicting plugin. Once again, great plugin – thanks again.

  22. 72
    iair Argentina »
    wrote, on 13/Jun/13 at 2:43 am # :

    Is it working? I noticed twitter deprecated API V1, and now requires authentication.
    Please update on this!

    Thank you!

  23. 73
    oriste Germany »
    commented, on 27/Jun/13 at 9:15 am # :

    Hi Ozh, I thought I keep patient for a while, but then it dawned on me, if nobody reacts you don't know how much interest there still is in your plugin. I for one would hate to see it go away, so if you have any plans to bring it up to date with Twitter's API 1.1 I'd like to hear it. Otherwise I'd be forced to have a stab at it myself and god only knows how bad that will be or how long it will take :P

  24. 74
    Ozh »
    commented, on 27/Jun/13 at 9:20 am # :

    oriste » I'll definitely update it, but I'm lacking time right now. Probably second half of July, or early August.

  25. 75
    Jeff Canada »
    commented, on 26/Jul/13 at 3:02 am # :

    Glad to hear you're looking to do an update for the new API. It's a nifty tool.

  26. 76
    JSantos France »
    said, on 05/Aug/13 at 5:02 pm # :

    Hi Ozh,
    Good to know that you will update Ozh' Tweet Archiver. Please don't quit on it :)
    It is a very nice plugin, works perfectly (till API change) and it would be problematic for me to change to another setup (don't even want to think about it).
    Anyway, thanks for your work.

  27. 77
    iair Argentina »
    wrote, on 22/Jan/14 at 7:23 pm # :

    For those still stuck on this.

    I've found this to be useful:
    Twitter to rss:

    either try this (php twitter to rss):

    http://webapps.stackexchange.com/questions/41499/any-alternatives-for-twitter-rss-after-native-service-is-shut-down

    or this: (free, twitter to rss)
    http://www.rssitfor.me/

    And if you need to post Tweets to a blog, try this WP plugin:

    http://wordpress.org/plugins/wp-rss-multi-importer/

    Thank you Ozh though, for trying to keep this project up. (maybe this suggestions also provide for the neccesary tweaks your plugin needs to be back on track)

  28. 78
    JSantos Switzerland »
    replied, on 09/Feb/14 at 3:25 pm # :

    Hi Ozh,
    I'm sure your lacking time, but could you let us know if you will or not update your plugin please? Just to know if i should look into a new way or still waiting for plugin update.
    Thanks man
    JS

  29. 79
    Ozh »
    commented, on 10/Feb/14 at 8:34 am # :

    JSantos: I still want to update that plugin, but I need to find a perfect and no-maintenance (ie maintained by someone else) Twitter oauth lib first

  30. 80
    JSantos France »
    wrote, on 17/Feb/14 at 8:11 pm # :

    Ok, thanks. I'll keep waiting for the updated version ;)

  31. 81
    oriste Germany »
    said, on 17/Feb/14 at 10:20 pm # :

    Ditto. Patiently and loyally… :P

  32. 82
    Ozh »
    commented, on 06/Apr/14 at 9:52 pm # :

    Peeps! I'm currently updating that plugin, at last. Expect an updated version in the next few days!

  33. 83
    JSantos Switzerland »
    said, on 06/Apr/14 at 10:22 pm # :

    The champagne is ready in the fridge :)

  34. 84
    oriste Cyprus »
    thought, on 06/Apr/14 at 10:47 pm # :

    w00t!

  35. 85
    Ozh »
    commented, on 08/Apr/14 at 12:00 am # :

    Peeps, it's almost there: https://github.com/ozh/ozh-tweet-archiver

    Still 2 minor bugs to fix but overall it seems to be working nicely. If you have a test install somewhere and want to play with it too, I'd appreciate feedback :)

  36. 86
    oriste United Kingdom »
    thought, on 12/Apr/14 at 11:08 am # :

    Oops! Only just now seeing this. Will get to work right away (as soon as I can bring this F@#$%&ng server back on its feet)…

  37. 87
    oriste United Kingdom »
    replied, on 12/Apr/14 at 6:55 pm # :

    Took a while, as my server was still playing up, some rogue process or something according to the host. Anyway, got the new plugin loaded, applied the modification that I did to version 1.0.1 again, launched…. et voilà! Took about the time to prepare dinner to update since June 2013 when it stopped working. I'm a happy camper now, see it at http://oriste.me

    Thanks a gazillion, Ozh!

  38. 88
    Ozh »
    said, on 13/Apr/14 at 10:40 am # :

    oriste » I'll update it soon, there's something that doesn't work as intended with the backup (it reads all tweets each time). In the meantime consider setting it to "once daily" if not done already

  39. 89
    Pierre Chaffard Australia »
    commented, on 13/Apr/14 at 2:46 pm # :

    Awesome news, can't wait for the upgrade

  40. 90
    Ozh France »
    wrote, on 14/Apr/14 at 11:53 pm # :

    Plugin updated and pushed to wp.org, doc here updated. Have fun.

  41. 91
    JSantos France »
    commented, on 15/Apr/14 at 12:14 am # :

    Thanks ;)

  42. 92
    JSantos France »
    wrote, on 15/Apr/14 at 6:25 pm # :

    Hi there,
    I dont know if I am doing something wrong, but first manual archive goes just fine and then later (with auto archive) some "tweets posts" lose the content of the post (entry) and they just keep the title of the post. It is very strange. Any idea?
    Thanks
    JS

  43. 93
    Ozh France »
    replied, on 15/Apr/14 at 6:50 pm # :

    JSantos » show me a tweet that failed, I'll check

Pages: « 1 [2] Show All

Leave a Reply

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.