Coder Social home page Coder Social logo

tweet.js-mod's Introduction

v1.4

Why?

seaofclouds / tweet has always been one of my preferred methods of client-side twitter integration. With the advent of Twitter's 1.1 API and the deprecation of 1.0, client side timeline fetching and parsing is no longer feasable due to the authentication restrictions imposed by OAuth. This exists to serve as a layer in between, serving the JSON directly to Tweet.js and caching it in a flat .json file to compensate for the v1.1 API's access limitations on sites which require more than ~12 loads of a user's timeline per minute.

This mod works as an intermediary between seaofclouds / tweet and the twitter JSON api which it uses to fetch tweets. It handles the server-side authentication process and (optionally) caches the JSON file locally to avoid being throttled, which it then passes off to seaofclouds / tweet as normal. Simple yet effective.

Features

  • Works with Twitter API v1.1.
  • Caches resources server-side in flat JSON files.
  • Easily configurable.
  • Supports all features of seaofclouds / tweet.
  • Supports OAuth Token Authentication (via Twitter App)

How to use

For existing seaofclouds / tweet users:

  1. Acquire /twitter/. How you wish to structure the files is up to you, but by default it is designed to be placed in the docroot of your website as a whole. (IE, domain.com/twitter).

  2. Replace your existing JS reference to jquery.tweet.js to the modified one provided. <script type="text/javascript" charset="utf-8" src="/twitter/jquery.tweet.js"></script>

  3. You need to have a twitter App for your usage in order to obtain OAuth credentials, see https://dev.twitter.com/apps for help.

  4. After creating your app, configure index.php with your OAuth credentials, and enable caching if you desire. Your cache directory of choice must be writable by PHP.

  5. If you keep index.php somewhere besides /twitter/, specify the path to it via the modpath option, relative to your domain. For example:

<script type="text/javascript">
$(document).ready(function() {
    $('.twitterfeed').tweet({
        modpath: '/assets/twitter/',
        count: 5,
        loading_text: 'loading twitter feed...',
        /* etc... */
    });
</script>
  1. That's all.

Caveats

  • Does not spontaneously spawn kittens. [in progress]

Support

If you are having issues, set $debug = true; in index.php. Errors should be logged to the JS console on execution.

If you still can't figure it out, feel free to contact me or submit an issue.

Unfortunately, I can not guarantee any support for this. I will, however, provide help and support within the constraints of my schedule.

tweet.js-mod's People

Contributors

stanscates avatar colorcrate avatar wietsewarendorff avatar koraysels avatar

Watchers

JT5D avatar James Cloos avatar  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.