Skip to content

Instantly share code, notes, and snippets.

@mcginty
Created February 26, 2012 01:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mcginty/deb9968e7998ed79b363 to your computer and use it in GitHub Desktop.
Save mcginty/deb9968e7998ed79b363 to your computer and use it in GitHub Desktop.
TwitterSentiment Datagram Specification
{
'input': {
'source': 'twitter',
'username': 'poopybutt800',
'displayname': 'Poopy Butt',
'userid': '5552174',
'url': 'https://twitter.com/#!/UnsoundedComic/status/173997828841029632',
'userimgurl': 'http://ilovecats.com/cat.jpg',
'raw_input': 'today is cold #amirite #thisisatag #blahblah http://twit.ly.poo/9j3j4k32',
'text': 'today is cold',
'metadata': ['#amirite', '#thisisatag', '#blahblah', 'http://twit.ly.poo/9j3j4k32']
},
/* BEGIN MUSIC GENERATION USES THIS */
'weights': {
'happiness': -10,10, /* sum of all scores, face weight added in, etc. */
'excitement': -10,10, /* exclamation points, absolute value of scores, etc. */
'randomness': -10,10
},
/* END MUSIC GENERATION USES THIS */
'sentiment':{
'text': {
'total_score': 4,
'positive_score': 8,
'negative_score': -4
},
'tweet': {
'hash_obnoxiousness': 9001,
'retweet': boolean
}
'face': {
'smiling': boolean,
'confidence': 78 /* % */
}
}
}
@joelspadin
Copy link

Can we add a permalink to the input source so the web interface can link to it? For example, a link to a tweet might look like https://twitter.com/#!/UnsoundedComic/status/173997828841029632

Also, having the user's display name would be nice. For example, my Twitter username is chaosinacan, but Twitter shows my real name (Joel Spadin) next to that.

@mcginty
Copy link
Author

mcginty commented Feb 27, 2012 via email

@joelspadin
Copy link

I don't know how to/if you can send a pull request on gists, but I added a 'displayname' attribute: https://gist.github.com/3d920f394ef5a1e7058d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment