摘要:
a[\s\S]*?href=("|')(?Plink[^\1]*?)\1[\s\S]*?img[\s\S]*?src=("|')(?Pimg[^\3]*?)\3 阅读全文
posted @ 2011-01-20 21:42
lexus
阅读(373)
评论(0)
推荐(0)
摘要:
a[\s\S]*?href=("|')(?Plink[^\1]*?)\1[\s\S]*?img[\s\S]*?src=("|')(?Pimg[^\3]*?)\3 阅读全文
posted @ 2011-01-20 21:42
lexus
阅读(373)
评论(0)
推荐(0)
摘要:
用ruby下载图片2009-08-04 22:38from: http://bbs.railschina.com/thread-23-1-1.htmlrequire "open-uri"data=open("http://bbs.railschina.com/images/default/logo.gif"){|f|f.read}open("logo.gif","wb"){|f|f.write(d... 阅读全文
posted @ 2011-01-20 21:42
lexus
阅读(604)
评论(0)
推荐(0)
摘要:
http://simohayha.javaeye.com/blog/147438 Alex学Ruby[ Hash方法汇总 ] 2008-07-20 21:24:36标签:Ruby 语法原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://blackanger.blog.51cto.com/140924/88709一。给Hash添加默认... 阅读全文
posted @ 2011-01-20 20:07
lexus
阅读(247)
评论(0)
推荐(0)
摘要:
#coding:utf-8class ::Stringdef find_tag_idx(tag,count=1) #html=html.to_s html=self current_count=0 idx=0 start=0 puts "===========" puts count puts current_count while current_count count idx=html.... 阅读全文
posted @ 2011-01-20 19:05
lexus
阅读(597)
评论(0)
推荐(0)
摘要:
Infinity = 1.0/0# a rather useless rangeeverything = -Infinity..Infinityputs everything.includes?(5) #- true 阅读全文
posted @ 2011-01-20 14:08
lexus
阅读(503)
评论(0)
推荐(0)
摘要:
#coding:utf-8def get_part(html,args={})puts htmlputs argsputs args[:s]puts "========"puts args["s"]puts args.key?(:s)puts args.key?("s")endhtml="abcd_abcd"s="a"e="d"get_part(html,:s=1,:e=2)a="中国a"pu... 阅读全文
posted @ 2011-01-20 10:27
lexus
阅读(238)
评论(0)
推荐(0)
摘要:
(一)Ruby中一切都是对象,包括一个常数.比如可以用.class属性来查看一个对象的类型,你可以看下1.class,会发现常数1的类型是Fixnum,1不过是Fixnum的一个实例。还可以使用-37这个Fixnum的实例方法abs来取得绝对值:-37.abs()会返回37又如输入一个1.1.class,会返回Float。(二)Ruby语法Ruby中的类以class开始 以end结束,类名首字母的... 阅读全文
posted @ 2011-01-20 09:56
lexus
阅读(2622)
评论(0)
推荐(0)
摘要:
http://lanwen.wordpress.com/2009/04/18/%E6%8A%8Ayahoo-yql-%E5%BD%93%E5%81%9A-crawler-%E6%9D%A5%E4%BD%BF%E7%94%A8/ Style: Background Foreground Link Color Link Visited Size: Width:More ▼ Open ModeOv... 阅读全文
posted @ 2011-01-20 00:26
lexus
阅读(267)
评论(0)
推荐(0)
|