question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prepare data for network analysis: Is it possible to use network.py with twarc2 downloaded tweets?

See original GitHub issue

I’ve downloaded with twarc2 a set of tweets in .jsonl and I am now trying to create .gexf or other network usable files (list of nodes and edges being able to select which relationship to use).

While running utils/network.py it throws some errors, as the names of the variables (that’s my guess) are not the same with the API 2 (id instead of id_str, author instead of user…) and the script is unable to process them.

Which way do you recommend to transform the data into files usable for data analysis? Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
numerotecacommented, May 17, 2021

I just added the minor changes of name variable and parsing noted above. See the current script: https://gist.github.com/numeroteca/aa040b0488c914d1e4a37e40117ef062

1reaction
edsucommented, Jun 27, 2021

Ok I’ve released a port of the old network.py script as a twarc2 plugin. You should be able to install it with:

pip install twarc-network

and then run it to generate a network as HTML D3:

twarc2 network tweets.jsonl network.html

More details about the various format options are available at https://github.com/docnow/twarc-network

Please ask questions about the plugin over in that issue tracker if you don’t mind too much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DocNow/twarc-network - GitHub
Generate network visualizations from Twitter data. ... quote, retweet and mention network from a file of tweets that you've collected using twarc.
Read more >
Twitter Data Collection Using Twarc - UNLV Libraries
With Twitter data you can create a ​network analysis​, which can help increase understanding of how movements form and organize online.
Read more >
Twitter Data Collection & Analysis - GitHub Pages
In this lesson, we're going to learn how to analyze and explore Twitter data with the Python/command line tool twarc. We're specifically going...
Read more >
twarc-network - PyPI
Generate network visualizations for Twitter data. ... quote, retweet and mention network from a file of tweets that you've collected using twarc.
Read more >
How to download and visualize your Twitter network
Using social network analysis, the Twitter API, Python, and Gephi to ... when downloading data from Twitter — you can only make a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found