GithubHelp home page GithubHelp logo

rajsingh7 / alchemyapi-twitter-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ujjwalkarn/alchemyapi-twitter-python

1.0 0.0 0.0 136 KB

A simple example application that will connect to the Twitter API, run a search, gather tweets, and then calculate the sentiment of each Tweet using AlchemyAPI's text analysis functions for entity extraction and sentiment analysis.

License: Apache License 2.0

alchemyapi-twitter-python's Introduction

alchemyapi-twitter-python

A simple example application that will connect to the Twitter API, run a search, gather tweets, and then calculate the sentiment of each Tweet using AlchemyAPI's text analysis functions for entity extraction and sentiment analysis.

For the walkthrough on how this software works, visit: http://www.alchemyapi.com/resources/tutorials/twitter-sentiment-analysis

Related Links

For more information on AlchemyAPI's sentiment analysis API: http://www.alchemyapi.com/products/features/sentiment-analysis/

For more information on AlchemyAPI's entity extraction API: http://www.alchemyapi.com/products/features/entity-extraction/

To try out all of AlchemyAPI's text analysis functions in an interactive web demo: http://www.alchemyapi.com/products/demo/

Requirements

How to Configure

After obtaining your API key from AlchemyAPI and your credentials from Twitter, you'll need to configure the app to use them.

To configure AlchemyAPI, run:

python alchemyapi.py YOUR_API_KEY

Just replace YOUR_API_KEY will your 40 character API key from AlchemyAPI.

To configure your Twitter credentials, create a new file called 'config.py' and put these two lines in it:

consumer_key = 'TWITTER_API_CONSUMER_KEY'
consumer_secret = 'TWITTER_API_CONSUMER_SECRET'

where TWITTER_API_CONSUMER_KEY and TWITTER_API_CONSUMER_SECRET are the values obtained from https://dev.twitter.com/apps

How to Run

Once you have everything configured, in your command window simply:

python analyze.py "SEARCH_STRING" COUNT

where SEARCH_STRING is what to search Twitter for, and COUNT is the number of Tweets to attempt to gather. For example, try:

python analyze.py "Denver Broncos" 150

A Note About Security

There are several pieces of secret information needed for this application: your API key from AlchemyAPI and your Twitter API credentials. It is important that you keep this information safe and secret, and that means keeping them out of GitHub or other source code manager. The application expects these secret values to be in api_key.txt and config.py, respectively, and make sure you keep these files in your .gitignore file. DO NOT HARDCODE THEM INTO YOUR APPLICATION FILES.

License

Copyright 2013 AlchemyAPI

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

alchemyapi-twitter-python's People

Contributors

alchemyapi avatar

Stargazers

 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.