Skip to main content

简化 Twitter API。

项目描述

易推特

通过利用 tweepy API 来简化 Twitter API。

所需步骤

  1. 获取 Twitter 开发者账号。注册
  2. 安装熊猫包。
  3. 安装 Numpy 包。
  4. 安装 Tweepy 包。
# packages installation "In terminal"
conda install pandas
conda install numpy
pip install tweepy
# importing packages in your jupyter notebook
import pandas as pd		# Please use the abbreviation "pd"
import numpy as np		# Please use the abbreviation "np"
import tweepy

安装

# how to install easytwitter package
pip install easytwitter

用法

  • 导入模块
# use * to access all the objects
from easytwitter import *
  • 首先你应该建立连接
# returns 4 inputs to validate your twitter tokens.
user.connect_me()

# consumer_key = "xxxxxxxxxxxxxxxxxxxx"
# consumer_secret = "xxxxxxxxxxxxxxxxxxxxxxx"
# access_token = "xxxxxxxxxxxxxxxxxxxxxx"
# access_token_secret = "xxxxxxxxxxxxxxxxxxxxxxx"

API 参考

get_user_timeline()

返回特定 Twitter 帐户的最新 20 条推文的摘要。

# if you want to interact with the data, store it in a new dataframe
df = user.get_user_timeline()
df.head()

get_followers_details()

返回用户的关注者详细信息。

df = user.get_followers_details()
df.head()

贡献

欢迎请求请求。对于重大更改,请先打开一个问题讨论您想要更改的内容。

执照

麻省理工学院

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

easytwitter-0.1.2.tar.gz (4.0 kB 查看哈希)

已上传 source

内置分布

easytwitter-0.1.2-py3-none-any.whl (4.2 kB 查看哈希)

已上传 py3