希网3322域名更新脚本(Python)
来源:互联网 发布:10型军用巧克力淘宝 编辑:程序博客网 时间:2024/05/17 22:41
import re,urllib2class DDNS: def getip(self): try: myip = self.visit("http://www.whereismyip.com/") except: try: myip = self.visit("http://www.ip138.com/") except: myip = None return myip def visit(self,url): opener = urllib2.urlopen(url) if url == opener.geturl(): str = opener.read() return re.search('\d+\.\d+\.\d+\.\d+',str).group(0) def updateIP(self): ip=self.getip() if(ip==None): break auth= urllib2.HTTPPasswordMgrWithDefaultRealm() url = "http://members.3322.net/dyndns/update?system=dyndns&myip="+ip+"&hostname=test.3322.org" auth.add_password(None, url, user='test',passwd='test123') handler = urllib2.HTTPBasicAuthHandler(auth) opener = urllib2.build_opener(handler) urllib2.install_opener(opener) f=urllib2.urlopen(url) print f.read()if __name__ == '__main__': DNS = DDNS() DNS.updateIP()
0 0
- 希网3322域名更新脚本(Python)
- 3322域名更新程序
- 更新hosts的python脚本
- 更新3322域名的ip地址
- 用libcurl实现3322域名更新
- Python更新notepad.cc文件脚本
- 更新hosts文件的python脚本
- python 批量写更新语句脚本
- python 脚本 通过解析 DDL 更新PDM
- 更新目录下SVN项目的python脚本
- 游戏更新维护serverlist服务器列表替换python脚本
- python脚本实现批量更新数据库中字段值
- Python脚本07 —— 替换模板中的七牛域名
- 域名过期提前预警脚本
- 域名过期提前通知脚本
- python域名查询工具
- python解析域名
- 调用域名注册api,查询所有域名组合脚本
- WireShark 过滤语法
- CreateFile函数祥解
- Apache与Nginx的优缺点比较
- sphinx安装
- 计算器的实现
- 希网3322域名更新脚本(Python)
- 用java简单的提取网页的a标签中href
- Ubuntu14.10 更新源 换成中国的源
- apache+mysql+php实现最大负载的方法
- 文件存储路径和权限
- 第八周项目4 String 类的构造
- 事务
- 批量图片缩小工具V1.08绿色版
- 自编码vs概率模型