GithubHelp home page GithubHelp logo

tebriel / tweet_loader Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 343 KB

Golang app to load your exported tweets from Twitter into ElasticSearch

License: Do What The F*ck You Want To Public License

Makefile 7.28% Go 92.72%

tweet_loader's Introduction

Tweet Loader

If you export all your tweets from the settings page in Twitter, maybe you then want to load them into ElasticSearch. I don't know if you want to do this, what am I, a wizard?

But if you do, then you can!

How To

  1. export ES_URL=http://your.es.instance:9200 FILENAME=./path/to/tweets.csv
  2. make run

What Do

This will create an index called "csvtweets" at the url specified, set up the mapping, then jam all those tweets into the index. Right now it does it in one huge bulk operation (TODO: Let's batch the bulk inserts).

Requirements

  1. Exported tweets.csv from twitter.com. Example lines look like this:
"tweet_id","in_reply_to_status_id","in_reply_to_user_id","timestamp","source","text","retweeted_status_id","retweeted_status_user_id","retweeted_status_timestamp","expanded_urls"
"700807342384746496","","15782607","2016-02-19 22:21:05 +0000","<a href=""http://tapbots.com/tweetbot"" rel=""nofollow"">Tweetbot for iΟS</a>","@jordansissel you were busy so I didn’t want to interrupt. But wanted to again say thanks for all your community work with #Logstash","","","",""
"700806305519251457","700802602011742209","16144388","2016-02-19 22:16:58 +0000","<a href=""http://tapbots.com/tweetbot"" rel=""nofollow"">Tweetbot for iΟS</a>","@shapr so it’s a problem, on some level that there isn’t huge adoption, so it’s hard to gain adoption. 5/5","","","",""
"700806106050727936","700802602011742209","16144388","2016-02-19 22:16:10 +0000","<a href=""http://tapbots.com/tweetbot"" rel=""nofollow"">Tweetbot for iΟS</a>","@shapr it’s not unmanageable, but it has a much higher overall barrier to entry than, say, go which is c++ like. ?/?","","","",""

Note I don't check to make sure the header is there, I just skip the first line. So if you're manually creating this for some reason (sure, it's your time you're wasting) add that header.

  1. Elasticsearch Instance. That seems pretty self explanatory, www.elastic.co if not.
  2. I dunno, desire to play around with my weird script.
  3. Golang environment, definitely a golang environment.

Loaded into Kibana

Here's a screenshot of it in Kibana, maybe that's proof that this worked for me that one time.

Kibana

tweet_loader's People

Contributors

tebriel avatar

Stargazers

SansGuidon avatar

Watchers

 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.