swdyh (owner)

Revisions

gist: 115874 Download_button fork
public
Public Clone URL: git://gist.github.com/115874.git
jetpack_tweet.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// set your twitter id and passowrd
var twitter_id = 'foo'
var twitter_password = 'bar'
var tw = new jetpack.lib.twitter.Twit(twitter_id, twitter_password)
 
jetpack.statusBar.append({
  html: '<img src="http://assets1.twitter.com/images/favicon.ico" />',
  width: 20,
  onReady: function(widget){
    $(widget).click(function() {
      var w = jetpack.tabs.focused.contentWindow
      var text = w.prompt('tweet')
      if (text) {
        tw.tweet(text, null, function() {
          jetpack.notifications.show('updated')
        })
      }
    })
  }
})