Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
ICONS=(
"Icon.png 57x57"
"[email protected] 114x114"
"Icon-72.png 72x72"
"[email protected] 144x144"
"Icon-Small.png 29x29"
"[email protected] 58x58"
"Icon-Small-50.png 50x50"
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 2 in line 1.
1,アメリカ合衆国, カナダ
1242,バハマ
1246,バルバドス
1264,アングィラ
1268,アンティグア・バーブーダ
1284,英領ヴァージン諸島
1340,米領ヴァージン諸島
1345,英領ケイマン諸島
1441,バミューダ諸島
1473,グレナダ
# -*- coding: utf-8 -*-
require 'open-uri'
require 'nokogiri'
url = "http://ja.wikipedia.org/wiki/国際電話番号の一覧"
dom = Nokogiri(open(URI.encode(url)).read)
callcode = []
dom.search('table.wikitable tr').each do |record|
head = record.search('th')
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 2 in line 1.
1,アメリカ合衆国, カナダ
1242,バハマ
1246,バルバドス
1264,アングィラ
1268,アンティグア・バーブーダ
1284,英領ヴァージン諸島
1340,米領ヴァージン諸島
1345,英領ケイマン諸島
1441,バミューダ諸島
1473,グレナダ
# -*- coding: utf-8 -*-
require 'open-uri'
require 'nokogiri'
url = "http://ja.wikipedia.org/wiki/国際電話番号の一覧"
dom = Nokogiri(open(URI.encode(url)).read)
callcode = []
dom.search('table.wikitable tr').each do |record|
head = record.search('th')
# -*- coding: utf-8 -*-
require 'amazon/ecs'
module Amazon
class Element
def to_hash
item_attr = self.get_element('ItemAttributes')
authors = item_attr.get_array('Authors')
authors = [item_attr.get('Author')] if authors.empty?
{
# -*- coding: utf-8 -*-
require 'nokogiri'
require 'mini_exiftool'
require 'fileutils'
class ImageFile
attr_accessor :filename, :exif, :lat, :lon, :diff
def initialize(path)
@filename = path
@exif = MiniExiftool.new(path)
# -*- coding: utf-8 -*-
require 'amazon/ecs'
BROWSE_NODE = {
"apparel" => "361245011",
"baby" => "344845011",
"books" => "465610",
"classical" => "562034",
"dvd" => "562004",
"electronics" => "3510411",
# -*- coding: utf-8 -*-
require 'jekyll'
require 'flickraw'
require 'fileutils'
require 'ostruct'
module Jekyll
class Site
attr_accessor :photostream, :photosets
def site_payload

{% flickr_link [photo id] [text] %}