GithubHelp home page GithubHelp logo

web5design / twitscript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apike/twitscript

0.0 3.0 0.0 60 KB

A port of Twython to Server Side Javascript (Node.js). Beautifully fun non-blocking Twitter API calls for epic win.

twitscript's Introduction

Twitscript - a Server Side Javascript library to interface with Twitter (Node.js)

Node.js is an incredibly cool way to handle server-side Javascript. As I was hacking on another project of mine (Luno - http://github.com/ryanmcgrath/luno), I found myself wishing I had an easy to use Twitter API wrapper.

Now, I've already written one such library, albeit in Python (Twython - http://github.com/ryanmcgrath/twython), I decided... screw it, why not see how quickly I could port my earlier work?

Twitscript is the end product of about 6 hours of work, converting pure Python to JS. It covers Twitter's main and search APIs; OAuth and Streaming haven't been implemented in Twython yet, so there's no base to pull from, in that respect. If you'd like to see these features, fork away! ;)

Using Twitscript

It's pretty easy, to be honest. Throw Twiscript on your module path somewhere, require it, and have a blast! Most of the calls mirror Twitter API calls directly, and the source is fairly well documented - read through if you need anything.

var twitscript = require("twitscript");

var twitter = new twitscript.init({
    username: "username",
	password: "password",
	headers: "my headers",
	version: 1,
});

// All calls in Twitscript take an object w/ params as a first argument, and a callback function with Twitter data
twitter.updateStatus({status: "I'm updating my status!", in_reply_to_status_id: "example_id"}, function(data) {
    sys.puts(data);
});

Beautiful, right? We all love the non-blockage. If you have any questions, comments, complaints, whatever, feel free to hit me on my email. I'm also on Twitter, if you'd like more up to date mundane information about my life.

ryan [at] venodesigns [dot] net http://twitter.com/ryanmcgrath

twitscript's People

Contributors

aviflax avatar

Watchers

 avatar  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.