资源说明:a ruby binding for accessing the GameFAQs database (game reviews, faqs, cheats)
h1. GameFAQs Library This is a simple gem which gives you access to information about all games (any platform) from GameFAQs.com You can search for games by title and platform, and then view _Reviews_, _FAQs_, _Cheats_ and _Answers_ for it. h2. Installation @gem install Soleone-gamefaqs --source=http://gems.github.com@ (Case sensitive!) h2. Getting started @require 'gamefaqs'@ h3. Find games and platformsh3. Examples for quick random quotes# Search for a game containing two words on the Nintendo DS game = GameFaqs::Search.game("Castlevania Ecclesia", "DS") # You can also search starting from the platform snes = GameFaqs::Platform.find("snes") game = snes.find("super mario world")
h3. Top 10 Games Get the most anticipated games for any platform at the moment. !http://i464.photobucket.com/albums/rr9/dennistheisen/11-18-20085-36-36AM-TOP_GAMES.png!include GameFaqs game = Game.find("super mario land", "game boy") # The title of a random review for Super Mario Land Random.review(game).title # long version Random.review("super mario land", "game boy").title Random.one_line_review(game) # => "Not Nintendo's (or my) best, but still a decent effort." - 6/10 Random.one_line_review(game, :detailed => true) # => "Super Mario Land [Game Boy]: Not Nintendo's (or my) best, but still a decent effort." - 6/10 # The title of a random user question for a game question = Random.question(game).title
h3. Reviews You can get score(s) for a game, and also read detailed articles. The reviews range from _quick_ over _detailed_ to _full_. !http://i464.photobucket.com/albums/rr9/dennistheisen/11-18-20085-47-12AM-REVIEWS.png!List.top_games("xbox 360")
!http://i464.photobucket.com/albums/rr9/dennistheisen/11-18-20085-15-53AM-review.png!# Get the average score from all reviews game.average_score # Get the average score from only detailed reviews (there are :detailed, :full and :quick) game.average_score(:detailed) # Get all reviews for this game reviews = game.reviews # Get only quick reviews for this game reviews = game.reviews(:quick) # Get the first review in the list review = reviews.first # Score in the format 9/10 review.score
h3. Questions (and Answers) Users can post questions for any game (many different categories, e.g. technical or plot). Other users then write a solution for that problem. It's very Forum-like. !http://i464.photobucket.com/albums/rr9/dennistheisen/11-18-20085-18-46AM-RedAlertQNA.png!# Get the full text of the review (original html stripped/converted) review.text # Other information review.title review.created_at review.author
h2. Requirements *Hpricot* (will be installed automatically by RubyGems as a dependency) h2. Issues Speed! Because sometimes there have to be multiple webpages parsed at once. For example to retrieve the names of all games for a platform, at least 26 pages need to be parsed (one for each letter of the alphabet). h2. Bugs If you're having any problems or exceptions while using this library, I encourage you to add a ticket (the detailed the better) to the issue tracker below: "http://soleone.lighthouseapp.com/projects/20137-gamefaqs":http://soleone.lighthouseapp.com/projects/20137-gamefaqs h2. Contribute If you're interested in this kind of stuff and want to help improve this library, feel free to fork this project and send me pull-requests/patches.# Get an array with all user questions for a game game.questions question = game.questions.first # Get the number of answers for this question question.replies # Get the status of the question (e.g. already answered or not) question.status # Get an array of all the answers for this question question.answers
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。