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. jQuery EasyUI 折叠面板accordion的使用实例

    1.对折叠面板区域 div 设置 class=”easyui-accordion” 2.在区域添加多个 div, 每个 div 就是一个面板 (每个面板一定要设置 title 属性). 3.设置面板属 ...

  2. Day 4-7 -configparser模块

    此模块用于生成和修改常见配置文档,当前模块的名称在 python 3.x 版本中变更为 configparser. 常用方法: import configparser conf = configpar ...

  3. java日志框架之logback(一)——logback工程简介

    Logback工程 致力于成为log4j工程的继承者 Logback的架构足够泛型化,故能够应用于许多不同的环境.当前,logback划分为三个组件: logback-core logback-cla ...

  4. Swagger2常用注解及其说明 (转)

    Api 用在Controller中,标记一个Controller作为swagger的文档资源 属性名称 说明 value Controller的注解 description 对api资源的描述 hid ...

  5. sonar安装

    ##jdk不要用yum下载的 一.下载sonar源码 cd /usr/local/src wget https://sonarsource.bintray.com/Distribution/sonar ...

  6. vue element-ui 绑定@keyup事件无效

    解决办法: <el-input @keyup.native="ajax"></el-input> 加上.native覆盖原有封装的keyup事件即可

  7. sed命令参数之-r -i

    对于初学linux的朋友来说,能记住命令附带的一大帮参数就以及非常不容易了.好不容易把该用的参数都想全了.sed -irns 后面一大片脚本 ,一执行出错了 what!!!! 创建一下测试环境 hea ...

  8. 洛谷P3389 【模板】高斯消元法

    P3389 [模板]高斯消元法 题目背景 Gauss消元 题目描述 给定一个线性方程组,对其求解 输入输出格式 输入格式: 第一行,一个正整数 n 第二至 n+1行,每行 n+1 个整数,为a1​,a ...

  9. js中session操作

    // 保存数据到sessionStorage sessionStorage.setItem('key', 'value');   // 从sessionStorage获取数据 var data = s ...

  10. Codeforces Round #424 Div. 1

    A:二分答案,从左往右考虑每个人,选尽量靠左的钥匙即可. #include<iostream> #include<cstdio> #include<cmath> # ...