Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted code to utilize new twitter archive file format #5

Closed
wants to merge 1 commit into from

Conversation

dannydover
Copy link

Twitter changed the file format they use for their data export/archive function from CSV to JSON. (Details available here: https://kyleconroy.com/your-twitter-data) This pull request updates the original code to parse JSON rather than CSV.

…ON. This replaces csv which was old archive format.
@denis-trofimov
Copy link

Hi!
You are wonderful guy @dannydover!
Your code has worked for me just now.
P.S. I am sad to see devs in Twitter have added this new obvious bug "ID as a float JS number" in the export data feature.

@Lewiscowles1986
Copy link
Contributor

I got a CSV today. Not sure if it's all users or some, but yeah probably needs support for both.

@denis-trofimov
Copy link

denis-trofimov commented Jul 23, 2018

@Lewiscowles1986 Is it a good idea is to add command line parameter -json or - csv?
1.probably a different local server, not all get updated at the same time.
2.Maybe they found a bug in JSON and rollback to CSV format?

@lalaithan
Copy link

I got a JSON file the other day and a CSV file today, so I guess they went back. Anyone know why it would show an unknown syntax error on line 17 or 30 for the JSON version?

@Lewiscowles1986
Copy link
Contributor

Guys, I've read up more on this. Video record the two sessions. You're going to two similar screens which product different things. Check the URL

@koenrh
Copy link
Owner

koenrh commented Jul 30, 2018

It seems that Twitter now indeed offers two ways to export your data:

  1. "Your Tweet archive" (from your account page) (contains tweets.csv)
  2. "Your Twitter data" (from your Your Twitter data page) (contains tweet.js)

The first one is the one that is described in the README, and returns an archive that includes a simple CSV file containing all your tweets. The latter one returns a lot more (personal) data, and was likely introduced recently in response to new EU regulatory requirements (GDPR). I'm not sure if that option is even available to non-EU-accounts.

Could anyone of you (non-Europeans) confirm that the "Your Twitter data" feature is accessible outside the EU?

Alternatively, we could change the script so that it takes either a path to tweets.csv or tweet.js as argument, and internally either use a CSV or JSON reader, respectively (e.g.python deletetweets.py -d 2014-01-01 tweet.js). What do you think?

@lalaithan
Copy link

lalaithan commented Jul 30, 2018 via email

@koenrh
Copy link
Owner

koenrh commented Dec 30, 2018

I have updated the README to make sure people download the right archive (#10).

I prefer to keep this script as simple as possible, and only support the CSV file.

@koenrh koenrh closed this Dec 30, 2018
@YaguraStation YaguraStation mentioned this pull request Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants