GithubHelp home page GithubHelp logo

pixelgrinch / jquery-livetweet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from faisalman/jquery-livetweet

1.0 1.0 0.0 85 KB

A jQuery plugin to fetch tweets from Twitter

Home Page: http://www.dailygrind.it

JavaScript 100.00%

jquery-livetweet's Introduction

jQuery LiveTweet documentation

What it does

jQuery LiveTweet is a jquery plugin that fetches tweets from Twitter.

How to use it


<script src="jquery.js"></script>
<script src="jquery.livetweet.js"></script>
<script>
$(document).ready(function() {
	$('#your_element').livetweet({
		'username' : 'twitter_user'
	});
});
</script>

Options

  • username: Your twitter username. Defaults to jeresig (jQuery’s creator).
  • limit: Number of tweets returned. Defaults to 5.
  • timeout: Request timeout. Defaults to 2000 (2 seconds).
  • html_before: HTML to be rendered before tweets’ loop. Defaults to <ul>.
  • html_after: HTML to be rendered after tweets’ loop. Defaults to </ul>.
  • html_tweets: HTML pattern for tweets. Defaults to <li>{text}<br>{date}</li>.
  • use_relative_dates: Boolean. Uses relative dates (ie: 2 minutes ago). Defaults to true.
  • format_date: Date formatting function. Use it if you set relative dates to false. Defaults to a date like Wednesday 12 March 2011.
  • lang: Language for dates and messages. Currently supported languages are en, id, it, fr. Defaults to en.

Example


$("#your_element").livetweet({
	'username' : 'sergio_martino',
	'html_before' : 'These are my tweets:<br>',
	'html_tweets' : '{date} | {text}<br>',
	'html_after' : '<br>Hello!'	
});

Example with custom date and language


$("#your_element").livetweet({
	'username' : 'sergio_martino',
	'html_before' : 'These are my tweets:<br>',
	'html_tweets' : '{date} | {text}<br>',
	'html_after' : '<br>Hello!',
	'lang': 'it',
	'use_relative_dates' : false,
	'format_date' : function(js_date_object) {
		return my_date.getDay()+'/'+my_date.getMonth()+'/'+my_date.getFullYear();
	}
});

jquery-livetweet's People

Contributors

pixelgrinch avatar

Stargazers

 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.