Skip to content

v1.0.8

Compare
Choose a tag to compare
@edsu edsu released this 10 Mar 22:16
· 1188 commits to main since this release

This release updates the behavior of Twarc.follower_ids and Twarc.friend_ids to take a user_id as well as a screen_name.

It also includes an update to the configuration loading that makes programmatic use of Twarc easier. Now instead of your program needing to deal with figuring out what keys to give to twarc.Twarc, the constructor will attempt to load them from the environment or from the default config file $HOME/.twarc. So all you need to do is:

import twarc

t = twarc.Twarc()
for tweet in t.search("obama"):
  print(tweet)

This release also includes a new utility utils/foaf.py which generates a friend-of-a-friend network for a given seed user. It expresses the network as a tuple of (user1_id, user2_id) where user1_id is the user id for a user (natch) and user2_id is the user id for their friend (someone they follow). I'm sorry if your hopes were up for some kind of RDF graph... If they aren't completely dashed here's how you can use it:

utils/foaf.py danbri > danbri.csv

Perhaps expressing this with output similar to utils/network.py could be useful at some point, but this satisfied the requirements of the person (/me waves to Ernesto) who needed the data to work with in R.