Skip to content

Instantly share code, notes, and snippets.

View strviola's full-sized avatar

strviola strviola

View GitHub Profile
require 'gitlab' # install by Gemfile
require 'pry' # install by Gemfile
require 'csv'
Gitlab.configure do |config|
config.endpoint = 'YOUR_GITLAB_URL'
config.private_token = 'YOUR_GITLAB_PRIVATE_TOKEN'
end
Gitlab.projects.auto_paginate do |project|
@strviola
strviola / nico_parser.rb
Last active January 26, 2018 14:19
ニコニコ動画サムネイルダウンローダ
# thanks to http://swiftfox.blog6.fc2.com/blog-entry-301.html
require 'net/http'
require 'uri'
require 'nokogiri'
require 'open-uri'
def get_parser(url)
uri = URI.parse(url)
html = Net::HTTP.get(uri)
@strviola
strviola / convert_prefecture_cities.rb
Created October 26, 2017 01:54
総務省「統計に用いる標準地域コード」から地名を抜き出す
require 'csv'
# data to write
cities_data = []
# download CSV from http://www.soumu.go.jp/main_content/000323625.csv as tmp/cities_jp.csv,
# convert charset to UTF-8, and rename headers as below
# ken-code => prefecture_id
# sityouson-code => city_code