TwitterX Icon

TwitterX

By Qodo (qodo)

TwitterX first screenshot

TwitterX v1.3.7

This package loads Twitter feeds and searches using the new (and very annoying) Twitter 1.1 API. You will need to create a Twitter app here: https://dev.twitter.com/apps/new

Once you've created your new application you will need to generate tokens and use those tokens when you call the TwitterX snippet which will load your statuses:

Snippet TwitterX

This should be called uncached if you are using :ago in the chunk otherwise it can be cached.

[[!TwitterX?     &twitter_consumer_key=`aaaa`    &twitter_consumer_secret=`bbbb`     &twitter_access_token=`cccc`     &twitter_access_token_secret=`dddd`    &limit=`4`    &timeline=`user_timeline`    &chunk=`TwitterXTpl`    &cache=`7200`      &screen_name=`Qodo` &include_rts=`1` ]]

  • twitter_consumer_key - your twitter consumer token (REQUIRED)
  • twitter_consumer_secret - your twitter consumer secret (REQUIRED)
  • twitter_access_token - your twitter access token (REQUIRED)
  • twitter_access_token_secret - your twitter access token secret (REQUIRED)
  • limit - limit how many statuses to display (default: 5)
  • timeline - which twitter timeline to load (default: user_timeline)
  • chunk - which chunk to load when rendering the statuses (default: TwitterXTpl)
  • cache - how many seconds to cache the twitter data feed (default: 7200)
  • screen_name - which user(s) you want to load (comma separated)
  • include_rts - should this include retweets (default: 1)
  • ** NEW ** exclude_replies - should this exclude replies (default: 0)
  • cache_id - unique ID for caching in case you want to view multiple feeds or different feeds  (default: TwitterX_PAGEID)
  • toPlaceholder - a placeholder ID if you want to use content as a placeholder instead of outputting directly (default: '')
  • toPlaceholderPrefix - if you want to prefix the placeholder values. E.g. 'twitterx' would create placeholders like [[*twitterx.text]] (default: '')
  • search - search Twitter using a search value. When using this parameter, screen_name and timeline are ignored. (example: &search=`MODX`)
  • slug - for when loading a twitter list, you must specify a screen_name and a slug (default: '')

Loading timelines

As the 1.1 API is more restrictive the tweets available have changed. The snippet defaults to user_time line but you can load any of these:

  • public_timeline
  • public_timeline
  • friends_timeline
  • user_timeline
  • mentions
  • retweets_of_me
  • favourites

Loading lists ** New as of 1.3 **

You can now load lists by using the following:   

&timeline=`lists/statuses`    &slug=`NAME_OF_YOUR_SLUG`&screen_name=`SCREEN_NAME_OF_LIST_OWNER`

An example of this would be the MODX List: https://twitter.com/modx/the-modx-team   

&timeline=`lists/statuses`    &slug=`the-modx-team`    &screen_name=`modx`

Searching Twitter

TwitterX now supports basic Twitter searches using the &search parameter:&search=`MODX`

Snippet TwitterXFormat

Use this snippet in your chunk placeholders to format the status text and automatically link any search, usernames or topics:[[+text:TwitterXFormat]]

Chunk options

The package comes with a chunk for displaying the statuses called 'TwitterXTpl'. You can customise this by using the following placeholders:

  • created_at - date status was created
  • source - source of the Tweet (application like web, iOS etc)
  • id - status id on Twitter
  • text - status main text
  • name - Twitter name
  • screen_name - Twitter username
  • profile_image_url - Twitter avatar image url for this user (uses https as of version 1.3.3)
  • location - This users location
  • url - This users URL (if specified)
  • description - This users profile information

Retweets (where applicable)

  • retweet_created_at - date status was created
  • retweet_source - source of the Tweet (application like web, iOS etc)
  • retweet_id - status id on timeline
  • retweet_id_str - status id on Twitter (twitter.com/user/statuses/id_str)
  • retweet_text - status main text
  • retweet_name - Twitter name
  • retweet_screen_name - Twitter username
  • retweet_profile_image_url - Twitter avatar image url for this user (uses https as of version 1.3.3)
  • retweet_location - This users location
  • retweet_url - This users URL (if specified)
  • retweet_description - This users profile information

Further info

For information and support, check out my blog:

http://www.qodo.co.uk/blog/twitterx-a-new-modx-extra-for-pulling-in-twitter-feeds-using-api-1.1/

Qodo


New in TwitterX 1.3.7

Changelog for TwitterX package.

TwitterX 1.3.7 - 04/08/2015

  • Bug fix for retweet links not using screenname (thanks @pmacswebteam)

TwitterX 1.3.6 - 27/08/2014

  • Bug fix for retweet URLs being truncated.

TwitterX 1.3.5 - 05/07/2014

  • Small bug fix and updates for MODX 2.3

TwitterX 1.3.4 - 12/01/2014

  • Fixed bug when specifiying a limit of tweets along with includerts
  • New option to exclude replies using excludereplies option

TwitterX 1.3.3 - 31/10/2013

  • Updated to latest version of twitteroauth
  • Added changes from Dameon87 to change twitter profile images to https, sanitise content and improve TwitterXFormat - thanks!
  • Uploaded correct changelog, licence and readme (previous version was for a different extra)

TwitterX 1.3.2 - 04/09/2013

  • Added isset() to some elements to stop warnings/errors

TwitterX 1.3.1 - 23/08/2013

  • Fixed option for favourites (thanks @sepiariver)
  • Added option to prefix TwitterX placeholders

TwitterX 1.3 - 24/07/2013

  • Added option to view user lists

TwitterX 1.2 02/07/2013

  • Fixed twitter search problem - thanks @OostDesign

TwitterX 1.1 12/06/2013

  • Fixed problem where it was ACTUALLY using Twitter 1.0 API instead of 1.1!
  • Changed cachedid to not automatically append PAGEID
  • Removed $limit+1 - it was always showing 1 more than specified

TwitterX 1.0 23/04/2013

  • Added multiple screenname option separated by comma, thanks @hvoort
  • Added option to do basic Twitter searches
  • Bug fixes

TwitterX 0.8 - 21/01/2013

  • Added option includerts to choose whether to include retweets.
  • Added options cacheid and toPlaceholder thanks to @sepiariver to allow for placeholder output and unique caching.
  • Fix for viewing Twitter favourites instead of regular statuses (thanks @sepiariver).
  • Added a few more comments.

TwitterX 0.7 - 01/12/2012

  • Fixed spelling mistake in error message
  • Added test for CURL as it's needed by twitter auth
  • Corrected parameter 'twitterconsumertokensecret' which should have been 'twitteraccesstokensecret' with support for the old

TwitterX 0.6 - 01/12/2012

  • Added option to view other users statuses using &screenname=Qodo

TwitterX 0.5 - 29/11/2012

  • Changed the way we limit the number of tweets - using twitter 'count' parameter instead of a limited loop.

TwitterX 0.4 - 15/11/2012

  • Bug fix for reporting errors (thanks Jeremy)

TwitterX 0.3

  • Added in caching of twitter data to protect against over using twitter limit
  • Added idstr available to chunk (thanks Laurent Mignot)
  • Updated to check for the twitteroauth class first
  • Corrected error in documentation (feed parameter should have been timeline)

TwitterX 0.2

  • First version

More

Information

Released
October 31, 2013
Supported Versions
2.1 – Current
Downloads
10,560
License
GPLv2

More from Qodo

TableOfContentsX

This extra creates a table of contents based on header tags.

View
SmushIt

This snippet tries to optimise and compress PNG and JPEG images for…

View