Git Product home page Git Product logo

twitterx's Introduction

TwitterX v1.0

This uses twitteroauth: https://github.com/abraham/twitteroauth

This package loads Twitter feeds 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,Microsoft &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, retweeted_by_me etc) 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 you want to load include_rts - should this include retweets (default: 1) cache_id - unique ID for caching in case you want to view multiple feeds or different feeds (default: TwitterX) toPlaceholder - a placeholder ID if you want to use content as a placeholder instead of outputting directly (default: '')

Loading timelines

The snippet defaults to user_time line but you can load any of these:

public_timeline public_timeline friends_timeline user_timeline mentions retweeted_by_me retweeted_to_me retweets_of_me

Searching Twitter

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

&search=MODX

When using this parameter, screen_name and timeline are ignored.

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 timeline id_str - status id on Twitter (twitter.com/user/statuses/id_str) text - status main text name - Twitter name screen_name - Twitter username profile_image_url - Twitter avatar image url for this user 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 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/

Created by Stewart Orr @ Qodo Ltd (http://www.qodo.co.uk). Contributers: @sepiariver (http://www.sepiariver.ca)

twitterx's People

Contributors

qodo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.