Giter VIP home page Giter VIP logo

twitter_crawler_prediction's Introduction

Twitter_Crawler_Prediction

Phase I. Collect Tweets

Overview

uses tweepy to interact with Twitter's API. Set size of chunk, chunk size, and number of chunk needed, chunk count. Save tweets into each chunk untill it's full, and save the chunk into a file, tweets<filecount>.txt. Python has the module json to convert json file to Python dictionary directly. Keep saveing file until it reaches the chunk count.

Limitations

tweets will be missed during the reinitialization of the stream if twitter connection is interrupted.

Instructions on running the crawler:

  1. ./twitterStream.sh<chunk size><chunk count>
  2. Scans files for urls. If url found, retreives the title of the linked page. Parses through files tweets0.txt - tweets.txt twitterURLFinder.py <fileCount>

Phase II.

Overview

Back End

Implement indexing and searching function with Whoosh library in Python.

Front End

Build web-based interface with Flask library in python. Implement map function with flask-googlemaps library.

Index Structures

Implement Okapi BM25 scoring function with Whoosh.

Add time factor: timeFactor = 1/(currentTime - tweetTime).

Most recent posts have largest value. It's then wegighted to blance its relevance to the BM25 score.

Overall Score = Score(BM25) + Score(time)

Limitations

  1. Take in duplicates and retweets as normal.
  2. It's not a dynamic interface.
  3. Most tweets don't have geo information.

Instructions on deploying the system

  1. pip install flask, flask-googlemaps, geocoder, whoosh.
  2. run indexSearch.py:
python indexSearch.py
  1. run app.py:
python app.py
  1. Input search query into the search box

image

image

twitter_crawler_prediction's People

Contributors

lwang031 avatar

Watchers

 avatar

twitter_crawler_prediction's Issues

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.