Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save koshigoe/8942 to your computer and use it in GitHub Desktop.
Save koshigoe/8942 to your computer and use it in GitHub Desktop.
Index: scripts/emoji_scrape.rb
===================================================================
--- scripts/emoji_scrape.rb (リビジョン 18881)
+++ scripts/emoji_scrape.rb (作業コピー)
@@ -77,17 +77,18 @@
end
def self.scrape_thirdforce
- base_uri = 'http://developers.softbankmobile.co.jp/dp/tool_dl/web/'
+ base_uri = 'http://creation.mb.softbank.jp/web/'
+ page = 'web_pic_%02d.html'
1.upto(6) do |n|
pict_scraper = Scraper.define {
- process 'td:nth-child(2) > font.j10', :unicode => :text
- process 'td > img', :image => '@src'
+ process 'td:nth-child(2)[bgcolor="#FFFFFF"]', :unicode => :text
+ process 'td > img', :image => '@src'
result :unicode, :image
}
Scraper.define{
process 'table[width="100%"] > tr', 'pictograms[]' => pict_scraper
result :pictograms
- }.scrape(URI.parse(base_uri + 'picword_%02d.php' % n)).select {|x| not x.nil? }.select {|x| not x.unicode.nil? }.each {|pictinfo|
+ }.scrape(URI.parse(base_uri + page % n)).select {|x| not x.nil? }.select {|x| not x.unicode.nil? }.each {|pictinfo|
tmpfile = File.join(emoji_dir('softbank'), pictinfo.unicode + '.tmp.gif')
filename = File.join(emoji_dir('softbank'), pictinfo.unicode + '.gif')
pict_uri = URI.parse(base_uri) + pictinfo.image
Index: libs/ssb.rb
===================================================================
--- libs/ssb.rb (リビジョン 18881)
+++ libs/ssb.rb (作業コピー)
@@ -40,7 +40,7 @@
['response is nil', 'N/A']
when ssb_response.instance_of?(String)
string_response(cgi_response, ssb_response)
- when ['301', '302'].include? ssb_response.code
+ when ['301', '302'].include?(ssb_response.code)
redirect_response(cgi_response, ssb_response)
else
ok_response(cgi_response, ssb_response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment