[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. mac OS X操作 -- 常用

    显示/隐藏默认隐藏文件:defaults write com.apple.finder AppleShowAllFiles -bool true/false 重置ROOT密码: http://www. ...

  2. zepto的bug2

    zepto的animate()源码采用css3的方式进行,而scrollTop属性不在css3的动画属性中,所以zepto不支持animate({scrollTop:"100px" ...

  3. 每天一个linux命令--su

    su命令和su -命令最大的本质区别就是:前者只是切换了root身份,但Shell环境仍然是普通用户的Shell:而后者连用户和Shell环境一起切换成root身份了. [richmail@porta ...

  4. JNDI 配置:JBoss + MySQL

    一.JNDI 名词解释 JNDI 是Java 命名和目录接口(Java Naming and Directory Interface,JNDI)的简称.从一开始就一直是 Java 2 平台企业版(JE ...

  5. HBase 分布式环境搭建

    一.前期环境 安装概览 IP Host Name Software Node 192.168.23.128 ae01 JDK 1.7, Zookeeper-3.4.5 HMaster 192.168. ...

  6. My97DatePicker控件

    本文只做了功能说明,详细请看http://www.my97.net/dp/demo/index.htm 二. 功能及示例 1. 常规功能 支持多种调用模式 除了支持常规在input单击或获得焦点调用外 ...

  7. gulp顺序执行任务

    gulp的任务的执行是异步的. 所以,当我写完一系列的任务,准备一股脑地执行. # gulp.task('prod', ['clean', 'compass', 'image', 'style', ' ...

  8. hibernate.cfg.xml配置文件和hbm.xml配置文件

    http://blog.sina.com.cn/s/blog_a7b8ab2801014m0e.html hibernate.cfg.xml配置文件格式 <?xml version=" ...

  9. jquery.cookie.js使用

    1.下载jquery.cookie.js 官网:http://plugins.jquery.com/cookie/ 或 http://pan.baidu.com/s/1mgynA8g 2.使用方法 $ ...

  10. Zepto Code Rush 2014 A. Feed with Candy

    此题用贪心求解, 首先将caramel drop类别的糖果按照高度从小到大排序,如果高度相同,按照重量从小到大排序 将fruit drop类别的糖果按照高度从小到大排序,如果高度相同,按照重量从小到大 ...