twitter api
1,twurl安装
1.1,安装软件管理包工具,在管理员身份打开的cmd中执行:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
1.2,choco install ruby
1.3,gem install twurl
1.4,gem install jq 格式化json
2,注册twitter开发者账号
https://developer.twitter.com/
3, 使用Restful api
3.1 获取用户最新发布(文档的Tweets下面):
Get Tweet timelines
Filter realtime Tweets standard api for free
Sample realtime Tweets
Things every developer should know
There are different API families
The standard (free) Twitter APIs consist of REST APIs and Streaming APIs.
The enterprise (paid subscription) APIs include filtered firehose, historical search and engagement APIs for deeper data analytics, listening and other enterprise business applications.
The premium (pay as you go) APIs consist of reliable and affordable versions of enterprise APIs, allowing your business to grow with your usage.
Additionally, there are some families of APIs (such as the Ads API) which require applications to be whitelisted in order to make use of them.
The API aims to be a RESTful resource
With the exception of the Streaming API and Account Activity webhooks, the Twitter API endpoints attempt to conform to the design principles of Representational State Transfer (REST). Twitter APIs use the JSON data format for responses (and in some cases, for requests).
The API is HTTP-based (over SSL)
Methods to retrieve data from the Twitter API require a GET request. Methods that submit, change or destroy data require a POST. A DELETE request is also accepted for methods that destroy data. API methods that require a particular HTTP method will return an error if not invoked using the correct style. HTTP Response Codes are meaningful.
Tweet IDs can break Javascript
Use the id_str field instead of id whenever present to stay safe. Web browsers/Javascript interpreters/JSON consumers may munge large integer-based ids, which is why it is recommended to use the string representation. See the documentation on Twitter IDs (snowflake).
There are limits to how many calls and changes can be made in a day
API usage is rate limited, with additional account-based fair use limits on write/create/delete endpoints, to protect Twitter from abuse.
Parameters have certain expectations
Some API methods take optional or requisite parameters. Keep in mind when making requests with parameters:
- Parameter values should be converted to UTF-8 and URL encoded.
- The page parameter begins at 1, not 0.
Where noted, some API methods will return different results based on HTTP headers sent by the client. Where the same behavior can be controlled by both a parameter and an HTTP header, the parameter will take precedence.
There are pagination limits
REST API Limit
Clients may access a theoretical maximum of 3,200 statuses via the page and count parameters for the user_timeline REST API methods. Other timeline methods have a theoretical maximum of 800 statuses. Requests for more than the limit will result in a reply with a status code of 200 and an empty result in the format requested. Twitter still maintains a database of all the Tweets sent by a user. However, to ensure performance, this limit is in place on the API calls.
There are Twitter API libraries for almost any language
The community has created numerous Twitter API libraries. If you know of others we haven’t listed, let us know via the developer forums.
twitter api的更多相关文章
- Twitter API 申请key
最近听了一下coursera的python课(https://www.coursera.org/learn/python-network-data/home/welcome),讲的挺简单也挺有意思.其 ...
- Twitter API升级至1.1
Twitter API 1.1是至今最大的一次升级,从3月份提出,到6月11日1.0版本已经全面停止调用.关于1.1版本升级特性可访问: https://dev.twitter.com/docs/ap ...
- twitter api的使用获取关注者的时间线
# -*- coding: utf-8 -*- from tweepy import OAuthHandler import datetime import pandas as pd import t ...
- twitter api的使用
1.用手机号注册推特账号 https://twitter.com/ 2.进入网站 https://apps.twitter.com/ 创建第一个app,填入基本信息 name写完会检测是否已经存在像我 ...
- twitter api取出的日期格式化
import pickle import datetime crate_time_list=[] twitter_id_list=[] twitter_url_list=[] twitter_text ...
- Twitter search API
Twitter crawler 与sina 微博类似,使用twitter api之前,首先要有twitter的账号,在twitter developer中创建应用(https://apps.twitt ...
- 【337】Text Mining Using Twitter Streaming API and Python
Reference: An Introduction to Text Mining using Twitter Streaming API and Python Reference: How to R ...
- 分享前端Facebook及Twitter第三方登录
最近公司要求做海外的第三方登录:目前只做了Facebook和Twitter;国内百度到的信息太少VPN FQ百度+Google了很久终于弄好了.但是做第三方登录基本上都有个特点就是引入必须的js,设置 ...
- 常用open api
SNS类网站API Facebook - http://developers.facebook.com/ 人人网开放平台 - http://dev.renren.com/ 51.com开放平台 - h ...
随机推荐
- [转帖]wifi 4G 和 蓝牙的区别
作者:沈万马链接:https://www.zhihu.com/question/64739486/answer/225227838来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注 ...
- 1363. ZigZag Conversion
public class Solution { /** * @param s: the given string * @param numRows: the number of rows * @ret ...
- 使用withCount后再使用select设置查询的字段。就找不到withCount的数据了
https://laravelacademy.org/index.php/discussion/1021 如:Article::withCount(['comments'])->select(' ...
- RPC框架-RMI、RPC和CORBA的区别
关键词:RMI RPC CORBA简 介:本篇文章重点阐述RMI,附带介绍RPC和CORBA Java远程方法调用(Java RMI)是一组实现了远程方法调用(rmi)的API. java RMI是远 ...
- windows环境下的git安装及使用
昨天晚上,我用了一个半小时整github,为了便于他人能快速的安装使用,也为了回顾一下自己痛苦的过程,特意写下这篇博客.好的,让我们开始吧.... 我的环境:win10,msysgit1.9.4.0 ...
- mysql关联、子查询索引优化
1.驱动表:加索引不起作用,因为全表扫描.表1 left join 表2 ,此时表1是驱动表 被驱动表:给这个加索引. 关联查询 子查询时 尽量不使用not in 或者not exists 而是用 ...
- SimpleChannelInboundHandler与ChannelInboundHandlerAdapter
参考https://blog.csdn.net/u011262847/article/details/78713881 每一个Handler都一定会处理出站或者入站(也可能两者都处理)数据,例如对于入 ...
- 配置Google Gmail分类和过滤器
简单的记两笔. 首先点击右上角的⚙️里面选择settings. 选择Filters and Blocked Addresses 在这个页面可以选择 create a new filter创建一个新的过 ...
- react & youtube
react & youtube https://www.npmjs.com/package/react-youtube https://developers.google.com/youtub ...
- tomcat9 点击bin目录下的startup.bat一闪而过
我装的是tomcat9免安装版,jdk版本是11,之后去tomcat bin目录下点击startup.bat闪退(好吧,只有想办法解决了) 博客中的解决办法五花八门,什么环境变量没配好....不过都不 ...