Skip to content
Matthew R. DeVerna edited this page Aug 23, 2021 · 37 revisions

Introduction

The OSoMeTweet project intends to provide a set of tools to help researchers work with Twitter's V2 API. The Wiki provides detailed instructions about the tools and will also work as an unofficial archive of knowledge gathered by people throughout the process.

In the sidebar, you should see links to pages that are prefixed with either "Info" or "Method". Info pages are simply archived knowledge that we found useful and Method pages detail how to use some portion of the osometweet package.

osometweet package overview

Each section below describes some portion of the package (as well as the information in this Wiki) and links to more details.

Install

See the README.md page to learn how to install the osometweet package.

Authentication

Before you can gather any data from Twitter, you must create an authentication object. See page Method: Authentication for instructions on how to create an authentication object and use it to initialize the OsomeTweet class.

Search Endpoints

Streaming Endpoints

Streaming endpoints allow you to collect tweets in real-time.

  • Method: Streaming - Collect tweets using either the filtered stream (tweets that match user-provided criteria) and sampled stream (a general 1% sample of all Twitter activity) endpoints.

Tweet endpoints

Tweet endpoints allow you to download tweets using the API. Here are the endpoints currently supported by osometweet:

User endpoints

User endpoints allow you to download user information using the API. Here are the endpoints currently supported by osometweet:

  • Method: User lookup - Gather account data about specific users (using their user_id or username).
  • Method: Follows lookup - Download all users that a specific user follows (following), or is followed by (followers).

Fields & expansions

V2 API, by default, only returns limited information. To fetch more, you will need to specify the fields and expansions parameters in the requests. OSoMeTweet contains several classes to handle them. See Method: Specifying fields and expansions for examples of how to work with them.

Utility Methods (osometweet.utils)

osometweet offers some utility functions to make your life easier, see Method: Utility functions for details.

Wrangle Methods (osometweet.wrangle)

osometweet offers some functions for data cleaning that we hope will make your life easier. See Method: Wrangle Functions Intro for an introduction to these methods and check out Method: Wrangle Practical Walk through (flatten_dict) for a more in-depth and practical application of the flatten_dict method.

Scripts

Functional scripts which use the osometweet package can be downloaded from the examples/ folder.

Official Twitter Documentation