Last active
September 28, 2024 18:04
-
-
Save jiskanulo/364d0bf7b90e07e6917b to your computer and use it in GitHub Desktop.
Revisions
-
jiskanulo revised this gist
Jun 11, 2019 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,12 +14,12 @@ title = doc.title output_dir = "out/#{title}" FileUtils.mkdir_p(output_dir) # <span class="mdCMN09Image FnPreview" style="background-image:url(https://stickershop.line-scdn.net/stickershop/v1/sticker/19216656/iPhone/[email protected];compress=true);"></span> doc.xpath('//span[@class="mdCMN09Image FnPreview"]').each do |node| # style="background-image:url(https://stickershop.line-scdn.net/stickershop/v1/sticker/19216656/iPhone/sticker@2x.png;compress=true);" # https://stickershop.line-scdn.net/stickershop/v1/sticker/19216656/iPhone/sticker@2x.png sticker_url = "#{node["style"][/url\((.+)\)/, 1]}" file_name = output_dir + "/" + sticker_url.sub(/^http(s)*:\/\//, "").gsub(/\//, ".").split(";")[0] open(sticker_url) do |file| open(file_name, "w+b") do |out| -
jiskanulo revised this gist
Jun 11, 2019 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ require "bundler/setup" require "fileutils" require "nokogiri" require "open-uri" @@ -10,15 +11,15 @@ url = ARGV[0] doc = Nokogiri::HTML(open(url)) title = doc.title output_dir = "out/#{title}" FileUtils.mkdir_p(output_dir) doc.xpath('//span[@class="mdCMN09Image"]').each do |node| # style example:"width: 150px; height: 121px; background-image:url(https://sdl-stickershop.line.naver.jp/stickershop/v1/sticker/15832370/android/sticker.png;compress=true); background-size: 150px 121px;" # sticker_url example: https://sdl-stickershop.line.naver.jp/stickershop/v1/sticker/15832370/android/sticker.png;compress=true # file_name example: sdl-stickershop.line.naver.jp.stickershop.v1.sticker.15832370.android.sticker.png sticker_url = "#{node['style'][/url\((.+)\)/, 1]}" file_name = output_dir + '/' + sticker_url.sub(/^http(s)*:\/\//, '').gsub(/\//, '.').split(';')[0] open(sticker_url) do |file| open(file_name, "w+b") do |out| -
jiskanulo revised this gist
Jun 11, 2019 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ #!/usr/bin/env ruby require "bundler/setup" require "nokogiri" require "open-uri" url = ARGV[0] -
jiskanulo revised this gist
Jun 11, 2019 . 3 changed files with 22 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ /out /vendor This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # frozen_string_literal: true source "https://rubygems.org" gem "nokogiri" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ GEM remote: https://rubygems.org/ specs: mini_portile2 (2.4.0) nokogiri (1.10.3) mini_portile2 (~> 2.4.0) PLATFORMS ruby DEPENDENCIES nokogiri BUNDLED WITH 1.17.2 -
jiskanulo revised this gist
May 7, 2017 . 1 changed file with 11 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,8 +10,17 @@ doc = Nokogiri::HTML(open(url)) title = doc.title Dir.mkdir(title) unless Dir.exists?(title) doc.xpath('//span[@class="mdCMN09Image"]').each do |node| # style example:"width: 150px; height: 121px; background-image:url(https://sdl-stickershop.line.naver.jp/stickershop/v1/sticker/15832370/android/sticker.png;compress=true); background-size: 150px 121px;" # sticker_url example: https://sdl-stickershop.line.naver.jp/stickershop/v1/sticker/15832370/android/sticker.png;compress=true # file_name example: sdl-stickershop.line.naver.jp.stickershop.v1.sticker.15832370.android.sticker.png sticker_url = "#{node['style'][/url\((.+)\)/, 1]}" file_name = title + '/' + sticker_url.sub(/^http(s)*:\/\//, '').gsub(/\//, '.').split(';')[0] open(sticker_url) do |file| open(file_name, "w+b") do |out| out.write(file.read) end end end -
jiskanulo revised this gist
Dec 15, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
Empty file. -
jiskanulo revised this gist
Dec 14, 2015 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ # scrape-line-stamp get thumbnail images from [LINE STORE](https://store.line.me/home/ja). ## how to use ```sh $ ruby ./scrape-line-stamp https://store.line.me/stickershop/product/534/ja ``` ## require [nokogiri](http://www.nokogiri.org/tutorials/installing_nokogiri.html) -
jiskanulo created this gist
Dec 14, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/usr/bin/env ruby require 'open-uri' require 'nokogiri' url = ARGV[0] doc = Nokogiri::HTML(open(url)) title = doc.title Dir.mkdir(title) unless Dir.exists?(title) Dir.chdir(title) doc.xpath('//span[@class="mdCMN09Image"]').each do |node| system "wget #{node['style'][/url\((.+)\)/, 1]}" end