Skip to content

Instantly share code, notes, and snippets.

@zdepablo
zdepablo / search-twitter.py
Created March 3, 2014 15:36
Search tweets using TwitterAPI
from TwitterAPI import TwitterAPI
# Go to http://dev.twitter.com and create an app.
# The consumer key and secret will be generated for you after
consumer_key = <consumer-key>
consumer_secret = <consumer-secret>
# After the step above, you will be redirected to your app's page.
# Create an access token under the the "Your access token" section
access_token_key = <access-token-key>
@zdepablo
zdepablo / tag-sentiment-textalytics.py
Created March 3, 2014 15:34
Tag a twitter using Textalytics Media Analysis API
import smaclient
license_key = <textalytics-license-key>;
textalytics = smaclient.SmaClient(license_key)
doc = smaclient.Document('0', 'Italia se indigna por la negativa de #Barilla a hacer anuncios con gays')
doc.language = 'es'
doc.source = 'TWITTER'
@zdepablo
zdepablo / brand-sentiment.py
Created March 3, 2014 15:19
Analyze Twitter sentiment for your brand using Textalytics Media Analysis API
import smaclient
from TwitterAPI import TwitterAPI
import matplotlib.pyplot as plt
# Go to http://dev.twitter.com and create an app.
# The consumer key and secret will be generated for you after
consumer_key = <consumer-key>
consumer_secret = <consumer-secret>