[Twitter]

1. 在https://apps.twitter.com/创建新的应用

2. 在https://dev.twitter.com/rest/reference/post/statuses/update页面下的OAuth Signature Generator点击刚才创建的应用。

参考:
http://blog.csdn.net/csfreebird/article/details/18238465
https://dev.twitter.com/rest/reference/post/statuses/update

[Python]

1. 首先安装python-pip, 然后通过pip install tweepy, 此时运行脚本虽然成功但是会提示以下告警:

root@ubuntu1404:/home/chen# python postip.py
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning

2. 安装这些组件可以消除告警信息: pip install pyopenssl ndg-httpsclient pyasn1

#!/usr/bin/env python
import tweepy
import requests consumer_key = 'f....j'
consumer_secret = 'W....8'
access_token = '4....j'
access_token_secret = 'Q....M' auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth) html = requests.get('http://ip.3322.net')
api.update_status(status=html.text)

参考:

https://www.phodal.com/blog/python-pip-openssl-issue/

http://blog.topspeedsnail.com/archives/3380

将公网IP自动发到Twitter上的更多相关文章

  1. (转)内网网站发布到外网-nat123动态公网IP动态域名解析

    环境描述: 路由器分配的是动态公网IP,且有路由器登录管理权限,网站服务器部署在路由器内部网络.如何将内网网站发布到外网大众访问? 解决方案: 内网使用nat123动态域名解析,将域名实时固定解析到路 ...

  2. 腾讯云无法绑定公网IP问题解释与解决方案。

    http://blog.csdn.net/chenggong2dm/article/details/51475222 解释:公网IP并不直接配置在服务器上,而是在服务器外部的路由上,通过某种映射连接. ...

  3. Azure ARM (12) ARM模式下,在负载均衡器上设置多个公网IP地址

    <Windows Azure Platform 系列文章目录> 最近在帮助一个客户设置WAF (Web Application Firewall),WAF厂商要求在负载均衡器上,设置多个公 ...

  4. vultr 上实现高可用冗余浮动公网IP出口(使用BIRD+BGP协议)High Availability on Vultr with Floating IP and BGP

    官方文档: https://www.vultr.com/docs/high-availability-on-vultr-with-floating-ip-and-bgp https://www.vul ...

  5. Python 之自动获取公网IP

    Python 之自动获取公网IP 2017年9月30日 文档下载:https://wenku.baidu.com/view/ff40aef7f021dd36a32d7375a417866fb84ac0 ...

  6. 阿里云上安装启动nginx 以及在个人电脑上通过公网ip访问遇到的问题

    1.安装依赖包 //一键安装上面四个依赖 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel 2.下载并解压安装包 ...

  7. 阿里云弹性公网IP那些事 阿里云云栖号 6月1日 弹性公网IP是独立的公网IP资源,可以绑定到阿里云专有网络VPC类型的ECS、NAT网关、私网负载均衡SLB上,并可以动态解绑,实现公网IP和ECS、NAT网关、SLB的解耦,满足灵活管理的要求。阿里云弹性公网IP那些事 阿里云云栖号 6月1日 弹性络VPC类型的E

    阿里云弹性公网IP那些事 阿里云云栖号 6月1日 弹性公网IP是独立的公网关.私网负载均衡SLB上,并可以动态解绑,实现公网IP和ECS.NAT网关.SLB的解耦,满足灵活管理的要求.

  8. Linux 公网IP和内网IP,Dubbo提供者注册到了内网IP上怎么处理!

    1.将Linux的localhost 改为公网IP: 改完以后重启网卡,并刷新Hosts: 2.将提供者和消息者的Dubbo 都改为公网IP: 3.开放端口:

  9. linux之无公网ip的自动登录

    场景 对于有公网ip的链接方式我们都比较清楚了,但是有些服务器不允许直接登录或者没有直接登录的公网ip,所以只能通过一个可以直接登录的堡垒机跳转.这时需要你手动去敲ssh远程链接命令(例如:ssh r ...

随机推荐

  1. redis 存储session实现session共享

    nginx 作为代理 tomcat集群 redis存储共享session nginx采用轮询方式将动态请求反向代理给tomcat,tomcat通过加载相应jar包方式实现获得redis中共享的sess ...

  2. Sleep函数的真正用意

    转自:http://blog.csdn.net/boyuejiang/article/details/8908333 关于VOID Sleep(DWORD dwMilliseconds);函数,许多人 ...

  3. spring 干嘛用的,记录。以后用多了再补充

    http://zhidao.baidu.com/link?url=TVePPDbQU1n61s_Bu2FT9_YoJebaux8tYlNEZQhiHYHpT8QIbbyOSC8wDnpVmnmurwN ...

  4. CodeForces#275--DIV 2--B(BinarySearch)(!!)

    B. Friends and Presents time limit per test 1 second memory limit per test 256 megabytes input stand ...

  5. Only Link: Reading links for button/a etc

    When To Use The Button Element: https://css-tricks.com/use-button-element/ The Difference Between An ...

  6. BZOJ4356 : Ceoi2014 Wall

    求出左上角到每个需要保护的点左上角的最短路树,那么最优解一定圈住了它们. 然后将每个点拆成四个点,四个点之间如果没跨越最短路树的树边,那就连0权边. 每个需要保护的点四周4个点都不可通行,求出最短路即 ...

  7. iframe更新与隐藏

    http://blog.sina.com.cn/s/blog_535161d80100aho6.html 从近期项目中抽取出来的一个关于iframe进行控制的代码,不是很全,不过大体功能已经显示出来了 ...

  8. Windows 8 Tips

    Precisely this article is about Windows 8.1, the title uses Windows 8 due to the fact that Windows 8 ...

  9. IOS—UITextFiled控件详解

    IOS—UITextFiled控件详解 //初始化textfield并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGR ...

  10. bug:[NSKeyedUnarchiver initForReadingWithData:]: data is NULL

    一,经历 1.问题出在给NSMutableDictionary类型的字典设置内容上. [_dictRateApp setObject:[NSNumber numberWithBool:NO] forK ...