This guide now lives at https://github.com/joyeusenoelle/GuideToMastodon/ - please check there for updates, and feel free to submit a PR if you have suggestions or want to submit a translation!
This file contains 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 characters
require 'rubygems' | |
require 'nokogiri' | |
require 'httparty' | |
doc = Nokogiri(HTTParty.get('http://www.gutenberg.org/wiki/Harvard_Classics_(Bookshelf)')) | |
ids = doc.css('a').select{|a| a.attr('title') =~ /ebook:/ }.map do |a| | |
a.attr('title') =~ /ebook:(\d+)/ | |
{:title => a.text, :id => $1 } | |
end.compact.uniq |