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的更多相关文章

  1. Twitter API 申请key

    最近听了一下coursera的python课(https://www.coursera.org/learn/python-network-data/home/welcome),讲的挺简单也挺有意思.其 ...

  2. Twitter API升级至1.1

    Twitter API 1.1是至今最大的一次升级,从3月份提出,到6月11日1.0版本已经全面停止调用.关于1.1版本升级特性可访问: https://dev.twitter.com/docs/ap ...

  3. twitter api的使用获取关注者的时间线

    # -*- coding: utf-8 -*- from tweepy import OAuthHandler import datetime import pandas as pd import t ...

  4. twitter api的使用

    1.用手机号注册推特账号 https://twitter.com/ 2.进入网站 https://apps.twitter.com/ 创建第一个app,填入基本信息 name写完会检测是否已经存在像我 ...

  5. twitter api取出的日期格式化

    import pickle import datetime crate_time_list=[] twitter_id_list=[] twitter_url_list=[] twitter_text ...

  6. Twitter search API

    Twitter crawler 与sina 微博类似,使用twitter api之前,首先要有twitter的账号,在twitter developer中创建应用(https://apps.twitt ...

  7. 【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 ...

  8. 分享前端Facebook及Twitter第三方登录

    最近公司要求做海外的第三方登录:目前只做了Facebook和Twitter;国内百度到的信息太少VPN FQ百度+Google了很久终于弄好了.但是做第三方登录基本上都有个特点就是引入必须的js,设置 ...

  9. 常用open api

    SNS类网站API Facebook - http://developers.facebook.com/ 人人网开放平台 - http://dev.renren.com/ 51.com开放平台 - h ...

随机推荐

  1. emplace与insert的区别(C++11)

    转自时习之 C++11中大部分的容器对于添加元素除了传统的 insert 或者 pusb_back/push_front 之外都提供一个新的函数叫做 emplace. 比如如果你想要向 std::ve ...

  2. K3BOM跳层

    A自制件,B自制件,C外购件 ,结构为A-B-C 如果需要跳层,则设置A-B跳层,B-C跳层,则生成A计划订单,C计划订单, 假设单独A-B跳层,则MRP运算出的结果也是A计划订单,B计划订单,C计划 ...

  3. zepto的extend

    类型判断 var class2type = {},toString = class2type.toString,$={}; //判断类型 function type(obj) { return obj ...

  4. 定义一个内核panic问题

    出现问题时的反汇编为: /usr/src/debug/kernel-4.1.44-.aarch64/net/core/dev.c: 17800xffff800000860724 <__netif ...

  5. 记一次ntp反射放大ddos攻击

    2018/3/26 ,共计310G左右的DDoS攻击 临时解决办法:将web服务转移到同生产一个内网段的备份服务器a上,a提供web端口80,数据库通过内网连接还是沿用生产数据库. 后续解决办法:通过 ...

  6. 多IP地址--笔记

    多IP 地址特性使虚拟用户可以在一个load generator上运行且被识别为多个IP地址 1 虚拟IP是同一个generator上的多个IP,这种分配过程由controller自动来进行 2 对于 ...

  7. Java使用RabbitMQ之消息确认(confirm模板)

    RabbitMQ生产者消息确认Confirm模式,分为普通模式.批量模式和异步模式,本次举例为普通模式. 源码: package org.study.confirm4; import com.rabb ...

  8. FMC

    FMC (FPGA Mezzanine Card) 编辑 FMC:英文全称,FPGA Mezzanine Card.是一个应用范围.适应环境范围和市场领域范围都很广的通用模块.FMC连接器(FMC C ...

  9. bzoj4152-[AMPPZ2014]The_Captain

    Description 给定平面上的n个点,定义(x1,y1)到(x2,y2)的费用为min(|x1-x2|,|y1-y2|),求从1号点走到n号点的最小费用. Input 第一行包含一个正整数n(2 ...

  10. Linux命令归纳

    Linux基本命令 Linux Xshell远程连接 ssh 用户名@id地址 例如: ssh root@192.168.11.53 增加类指令 创建文件夹 mkdir 文件名 mkdir -p 路径 ...