Skip to content

Instantly share code, notes, and snippets.

@zdepablo
Created March 3, 2014 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdepablo/9327454 to your computer and use it in GitHub Desktop.
Save zdepablo/9327454 to your computer and use it in GitHub Desktop.
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'
response = textalytics.analyze(doc)
print 'Sentiment: ',response.result.sentiment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment