MikeJGilbert42 / wikivitals

An exploratory Rails single-serving app which finds the living status of a queried individual, by parsing their Wikipedia article.
1 stars 0 forks source link

== WikiVitals An exploratory Rails single-serving app designed to take a query for a person and output whether that person is alive or dead, based on their Wikipedia article. Topics to explore include TDD, robust template parsing with regular expressions, data relationship modeling, performance optimization, AJAX forms, and jQuery UI.

== Features

== Roadmap

== Examples Some functionality examples from the Rails console (with some debug output):

=== Basic operation $ albert = Person.find_person("Einstein") opening connection to en.wikipedia.org... opened <- "GET /w/index.php?action=raw&title=Einstein... -> "#REDIRECT [[Albert_Einstein]] {{R_from_surname}}" <- "GET /w/index.php?action=raw&title=Albert_Einstein -> "{{Infobox scientist\n| name = Albert Einstein\n...

=> #<Person id: 65, alive: false, updated_at: "2012-07-11 18:13:40", name: "Albert Einstein", ...

   $ albert.alive?
   # => false 
   albert.article_title
   # => "Albert_Einstein"
   albert.birth_date
   # => Fri, 14 Mar 1879

=== Personhood detection $ WikiRecord.fetch("Sherlock_Holmes").person?

=> false

=== Disambiguation page parsing $ smiths = WikiRecord.fetch("John_Smith")

=> #<WikiRecord id: 467, article_title: "John_Smith", article_body: ... >

   $ smiths.targets.count      # Get the number of people linked to from this disambiguation page
   # => 150
   $ smiths.targets.select(&:alive?)
   # => 57