Coder Social home page Coder Social logo

reliable-sources's Introduction

Reliable Sources

This is a command line tool that funnels a list of reliable on-the-scene sources from Twitter into a Google Spreadsheet.

This open-source project was created by Sara Simon and [Ariana Giorgi] (https://github.com/arianagiorgi). Thanks to OpenNews for their support.

Set Up and Installation

  1. Set up virtualenv and cd into it.
  2. Run pip install -r requirements.txt.
  3. Follow instructions in config_template.py to create your own config.py file.
  4. Follow instructions to connect to Google Drive below.
  5. You're ready to go! See usage examples.

Google Drive

This repo uses gspread to connect to Google Drive. Set up a new spreadsheet within your Google Drive, then set up a new project through the Google Developers Console. Enable the Google Drive API, and create credentials for a Service Account Key. You will receive a json file with credentials. Follow the template at credentials_template.json and rename to credentials.json.

You may need to share your Google Spreadsheet with the client_email given to you in credentials.json.

We've named our spreadsheet Reliable Sources. You can name your spreadsheet whatever you'd like. Simply change the spreadsheet name you call to open in access.py.

Usage

python main.py <location> <optional: keyword>

Examples

To search for any tweet out of Toronto: python main.py 'Toronto'

To search for tweets relating to the Boston marathon: python main.py 'Boston, MA' 'marathon' or for a certain hashtag: python main.py 'Boston, MA' '#MarathonMonday'

To search for tweets in New York mentioning Bernie Sanders: python main.py 'New York, NY' '@BernieSanders'

To search multiple hashtags, just extend the keyword string: python main.py 'New York, NY' '#feelthebern #latinosforbernie'

Some locations may be too specific for Twitter. On April 19th there was an explosion heard in Kabul, Afghanistan. To find relevant tweets, you can use: python main.py 'Afghanistan' 'kabul' or to be more specific, python main.py 'Afghanistan' 'kabul blast'

To search for pictures or videos of bikes in Austin: python main.py 'Austin' 'bike filter:media'

The Twitter API provides many other query operator examples here.

Twython

A list of interface options is available here.

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.