wiki-yggdrasil 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -4
- data/lib/wiki/yggdrasil.rb +1 -1
- data/lib/wiki/yggdrasil/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00dbd9fd8629186246281bb70c2e34567e9ea204b683641ecf80c9cbed397255
|
4
|
+
data.tar.gz: 7b95633e1f77dee6f21e80b3fb00a49a2e49bd676ed839833514c561ffaaca07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e48c1fbc87939aefc000e28cf3d5c31c2d11494f287155e0e74186435e0b2cec7f89e470074908b4caa5e170175eb9c55465c3854157f30a8799526e93c4321
|
7
|
+
data.tar.gz: ab38422b60f2f2e27c802d9b68c0f38355cefc50787965626db5f36a30c19f51482dfbb41a37fb03176a71bddf5998f8c871dad51d6d84e9cd9828dacbc693f0
|
data/README.md
CHANGED
@@ -12,7 +12,30 @@ Wiki::Yggdrasil takes a Wikipedia URI as an argument, and proceeds to spider out
|
|
12
12
|
require 'wiki/yggdrasil'
|
13
13
|
|
14
14
|
@tree = Wiki::Yggdrasil::Yggdrasil.new(uri: 'http://en.wikipedia.org/wiki/Yggdrasil')
|
15
|
-
referenced_articles = @tree.children(depth:
|
15
|
+
referenced_articles = @tree.children(depth: 1) ## A hash of of articles linked by the parent
|
16
|
+
```
|
17
|
+
The preceeding code produces a structure as follows:
|
18
|
+
```ruby
|
19
|
+
{:name=>"Help:IPA/English", :children=>[]}
|
20
|
+
{:name=>"Help:IPA/English", :children=>[]}
|
21
|
+
{:name=>"Old Norse", :children=>[]}
|
22
|
+
{:name=>"Help:IPA", :children=>[]}
|
23
|
+
{:name=>"Trees in mythology", :children=>[]}
|
24
|
+
{:name=>"Norse cosmology", :children=>[]}
|
25
|
+
{:name=>"<i>Poetic Edda</i>", :children=>[]}
|
26
|
+
{:name=>"<i>Prose Edda</i>", :children=>[]}
|
27
|
+
{:name=>"Snorri Sturluson", :children=>[]}
|
28
|
+
{:name=>"<i>Fraxinus excelsior</i>", :children=>[]}
|
29
|
+
{:name=>"Æsir", :children=>[]}
|
30
|
+
{:name=>"Thing (assembly)", :children=>[]}
|
31
|
+
{:name=>"Urðarbrunnr", :children=>[]}
|
32
|
+
{:name=>"Hvergelmir", :children=>[]}
|
33
|
+
{:name=>"Mímisbrunnr", :children=>[]}
|
34
|
+
{:name=>"Níðhöggr", :children=>[]}
|
35
|
+
{:name=>"Veðrfölnir and eagle", :children=>[]}
|
36
|
+
{:name=>"Dáinn, Dvalinn, Duneyrr and Duraþrór", :children=>[]}
|
37
|
+
{:name=>"Sacred trees and groves in Germanic paganism and mythology", :children=>[]}
|
38
|
+
{:name=>"Ragnarök", :children=>[]}
|
16
39
|
```
|
17
40
|
|
18
41
|
## FAQ
|
@@ -20,9 +43,6 @@ referenced_articles = @tree.children(depth: 3) ## A hash of of articles linked b
|
|
20
43
|
### This is taking a long time. Is that normal?
|
21
44
|
Yes. This is normal. Any Yggdrasil object created with a depth of three or higher will likely take a few minutes to scrape the necessary information.
|
22
45
|
|
23
|
-
### Why didn't you just use Wikipedia's API?
|
24
|
-
Wikipedia's API doesn't have an endpoint that allows you to programatically view the summary section of each article and its children. If it did that would obviously be the ideal choice.
|
25
|
-
|
26
46
|
## Installation
|
27
47
|
|
28
48
|
Add this line to your application's Gemfile:
|
data/lib/wiki/yggdrasil.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wiki-yggdrasil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alex0112
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|