0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Given a Wikipedia article, generate a tree of linked articles from the summary of the first.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.0
~> 3.0

Runtime

~> 1.10
 Project Readme

Wiki::Yggdrasil

Travis CI Build

Wiki::Yggdrasil takes a Wikipedia URI as an argument, and proceeds to spider out a dependency tree of referenced articles.

Usage

require 'wiki/yggdrasil'

@tree               = Wiki::Yggdrasil::Yggdrasil.new(uri: 'http://en.wikipedia.org/wiki/Yggdrasil')
referenced_articles = @tree.children(depth: 1) ## A hash of of articles linked by the parent

The preceeding code produces a structure as follows:

{:name=>"Yggdrasil",
 :children=>
  [{:name=>"Old Norse", :index=>1, :level=>1, :children=>[]},
   {:name=>"Trees in mythology", :index=>2, :level=>1, :children=>[]},
   {:name=>"Norse cosmology", :index=>3, :level=>1, :children=>[]},
   {:name=>"Norse cosmology", :index=>4, :level=>1, :children=>[]},
   {:name=>"<i>Poetic Edda</i>", :index=>5, :level=>1, :children=>[]},
   {:name=>"<i>Prose Edda</i>", :index=>6, :level=>1, :children=>[]},
   {:name=>"Snorri Sturluson", :index=>7, :level=>1, :children=>[]},
   {:name=>"<i>Fraxinus excelsior</i>", :index=>8, :level=>1, :children=>[]},
   {:name=>"Æsir", :index=>9, :level=>1, :children=>[]},
   {:name=>"Thing (assembly)", :index=>10, :level=>1, :children=>[]},
   {:name=>"Urðarbrunnr", :index=>11, :level=>1, :children=>[]},
   {:name=>"Hvergelmir", :index=>12, :level=>1, :children=>[]},
   {:name=>"Mímisbrunnr", :index=>13, :level=>1, :children=>[]},
   {:name=>"Níðhöggr", :index=>14, :level=>1, :children=>[]},
   {:name=>"Veðrfölnir and eagle", :index=>15, :level=>1, :children=>[]},
   {:name=>"Dáinn, Dvalinn, Duneyrr and Duraþrór",
    :index=>16,
    :level=>1,
    :children=>[]},
   {:name=>"Sacred trees and groves in Germanic paganism and mythology",
    :index=>17,
    :level=>1,
    :children=>[]},
   {:name=>"Ragnarök", :index=>18, :level=>1, :children=>[]}],
 :index=>0,
 :depth=>0}

Note: Any Yggdrasil object created with a depth of three or higher will likely take a few minutes to scrape the necessary information. If you'd like to contribute to making this process faster, check out this issue.

Installation

Add this line to your application's Gemfile:

gem 'wiki-yggdrasil'

And then execute:

$ bundle

Or install it yourself as:

$ gem install wiki-yggdrasil

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/alex0112/wiki-yggdrasil.

License

The gem is available as open source under the terms of the MIT License.