使用 jQuery 显示您在线活动的流
Show a stream of your online activity. Check out the example or create your own lifestream instantly.
Currently supports the following feeds:
Feel free to fork the project and add your own feeds in. Just send a pull request to christianvuerings/jquery-lifestream when you're finished.
cd build
make
Use make target and replace target with the target you want to use.
Add the following to the or tag of your HTML page.
The above code will always use the latest version of the script. If you want to use it in production, download the minified or uncompressed file and host it yourself.
You also need to add a bit of HTML:
You have the ability to use jQuery templates for your feed. Checkout the template page to see an overview of the current available templates.
Usage:
{
service: 'deviantart',
user: 'gabbyd70',
template: {
deviationpost: 'heeft hetvolgende gepost: ${title}'
}
}
The plug-in accepts one configuration JSON object:
$("#lifestream").lifestream({
classname: "lifestream",
feedloaded: feedcallback,
limit: 30,
list:[
{
service: "github",
user: "christianvuerings"
},
{
service: "twitter",
user: "christianvuer"
}
]
});
classname: The name of the main lifestream class. We use this for the main ul class e.g. lifestream and for the specific feeds e.g. lifestream-twitter
feedloaded: (function) A callback function which is triggered each time a feed was loaded.
limit: (integer) Specify how many elements you want in your lifestream (default = 10).
list: (array) Array containing other JSON objects with information about each item.
Each item should have a service and a user.
For more information about each service, check out the source code of the example page.
Adding in your own feed is pretty easy. Have a look at this commit which adds support for the last.fm feed.
var statements in the beginning of a functionfor (var i = 0, j = length; i < j; i++) {
.jshintrc contains the necessary configurationStuff that isn't implemented yet, but would be nice to have:
Places on the web where this plug-in got mentioned:
A list of sites that use the jQuery Lifestream plug-in:
Alesh Houdek, Armin Roșu, BrainDump2.0, Dennis Metzcher, Devin Berg, Erik Ostrom, Ethan Brown, Libby Baldwin, Sam Tardif, Sebastix, Simon Gaeremynck, Song Gao, Sunny Walker, Roni Laukkarinen
Special thanks all the committers and gabbyd70 for letting us use her DeviantART username.
Have a look at our tags to see what we've been working on.
暂无开放 Issues,或尚未同步最近议题。