Skip to content

Instantly share code, notes, and snippets.

@hearvox
hearvox / twitter_chat_archive.php
Created April 6, 2011 13:41
Archive tweets from a weekly Twitter chat. In this case, chat hashtag is #pubmedia (Mon 8p ET). Uses Twitter Search API and WordPress function: wp_remote_get().
<?php
/*
Twitter Chat Archive:
Get hashtag results from Twitter Search API (in JSON) for a weekly chat.
API takes date range via values: 'since' thru 'until' (YYYY-MM-DD).
API limits: 1 page per request, 100 results per page, 1500 total results: <7 days old.
Script below: Repeats page requests until no results found w/in date-range.
Then gathers only those results w/in specified timestamp range.
Then sort results from oldest to newest.