Gets a feed of a twitter users tweets from Twitter API v1.1
- Twitter account to create Developer App (to generate oAuth keys)
- PHP oAuth PECL extension
- Install oAuth php extension
sudo pecl install oAuth
- If you get an error complaining about prec not being available install that using
apt-get install libpcre3-dev
Then run the oAuth install again 3. Add the extension to php.ini
extension=oauth.so
- Restart Apache
service apache2 restart
- Install Magento module
- Login to Twitter developer site and create a new app (doesn't have to be on the account the feed will be pulled from)
- Create access tokens
- In magento admin system config find Aligent Feeds under Advanced and enter the consumer key/secret and access token/secret, enter the screen name for the twitter account to get the feed for as well as the amount of tweets to request, save config
- Add Aligent Feeds block in layout xml
<block type="aligent_feeds/twitter" name="social" template="aligent/feeds/twitter.phtml" />
- Twitter feed!
- The same application can be used for multiple feeds
- The Twitter API is strange in that the get replies option is filtered after the amount is retrieved, so if you request 20 tweets, and to exclude replies, you may end up with only 10 tweets. So if you want 20 tweets excluding replies you'll need to request either heaps and then trim to 20 (still not guaranteed), or keep requesting until you get your 20 tweets.