Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'rss'
require 'open-uri'
require 'uri'
# 日本人っぽいのだけ欲しい場合'
URL = 'http://xpathfeed.com/feed?url=http%3A%2F%2Fjp.xvideos.com%2F&xpath_list=%2F%2F*%5B%40class%3D%22thumbBlock%22%5D%2Fdiv%2Fp%5B1%5D%2Fa'
RSS::Parser.parse(open(URL).read).channel.items.each{|x|
uri = URI.parse x.link
@ssig33
ssig33 / xvideos.rb
Created November 1, 2012 03:59
xvideo から動画ダウンロードするやつ
#!/usr/bin/env ruby
#coding:utf-8
require 'mechanize'
alice = Mechanize.new
page = alice.get ARGV[0]
url = CGI.unescape page.root.xpath('//*[@id="flash-player-embed"]')[0]['flashvars'].split('&flv_url=').last.split('&').first
title = page.root.xpath('//div[@id="main"]/h2')[0].inner_text.to_s+'.flv'