tablehop 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tablehop.rb +20 -19
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a46398d203d42688245af0a3ed56b7ab1344623dbb213693575ea318d9f5887d
4
- data.tar.gz: 49f169e8fe0f7d7ce8da2e1131d3468a4e3549367b00bef10aaf8bc6e8cb5751
3
+ metadata.gz: 66f28c6e3887756d4c65a60cb78cbac6fb20a9b817d62864b04b81d10d3ba7df
4
+ data.tar.gz: a999822d9e7b5b9ba32e745499203f536c0afff6e8ee12c19dcc7c63bece3e3c
5
5
  SHA512:
6
- metadata.gz: b00ac5f0b87ec96eeb1c1b2089cb147b39395ba03022e5b44aadc35eb06870748bb29dfe275fab03168b3cf56f2e5d9c108bae53d60d26648e02769a4f203d20
7
- data.tar.gz: 1da65b83efb33f08b7e59d1447b6f75a5c6e0fa13991a3625631cbbf1f05f00de6df34617ff0d530465bdf1e86d1cfb2c27c4a2fa1e2e9677ca6b4fed4de6123
6
+ metadata.gz: 7024a3989466d8c37b49570a4675b1879a848cb41d73d0d638dcb48632686ccca8a5fea3bc0a739672ec9f4b75a504ee95c9306e8147acacc5047f7e7ae074ae
7
+ data.tar.gz: cb32e914579c70b5dccfa32d9fdf9cfb232a27a96443ae98ca8035b2937d9bd48dcac5bbf70c798b9fbf40e949ac2df1ceffc05d12235afef93321edf73694e2
data/lib/tablehop.rb CHANGED
@@ -4,28 +4,29 @@ require 'openssl'
4
4
  require 'json'
5
5
  require 'open-uri'
6
6
  require 'nokogiri'
7
- class Tablehop
8
- def self.getPopularGames
9
- recent_favourites = Nokogiri::HTML(URI.open("https://api.geekdo.com/xmlapi2/hot?type=rpg"))
10
- #puts doc.xpath('//html/body/items/item')[0]
11
- popular_games = []
12
- loop_length = recent_favourites.xpath('//html/body/items/item').length
13
- for item in 0..loop_length-1
14
- item_link = 'https://boardgamegeek.com/boardgame/' + recent_favourites.xpath('//html/body/items/item/@id')[item].to_s
15
- game_dict = {
16
- 'name' => recent_favourites.xpath('//html/body/items/item/name/@value')[item].to_s,
17
- 'image' => recent_favourites.xpath('//html/body/items/item/thumbnail/@value')[item].to_s,
18
- 'item_id' => recent_favourites.xpath('//html/body/items/item/@id')[item].to_s,
19
- 'item_link' => item_link
20
- }
21
- popular_games.append(game_dict)
7
+ module Tablehop
8
+ class Tablehop
9
+ def self.getPopularGames
10
+ recent_favourites = Nokogiri::HTML(URI.open("https://api.geekdo.com/xmlapi2/hot?type=rpg"))
11
+ #puts doc.xpath('//html/body/items/item')[0]
12
+ popular_games = []
13
+ loop_length = recent_favourites.xpath('//html/body/items/item').length
14
+ for item in 0..loop_length-1
15
+ item_link = 'https://boardgamegeek.com/boardgame/' + recent_favourites.xpath('//html/body/items/item/@id')[item].to_s
16
+ game_dict = {
17
+ 'name' => recent_favourites.xpath('//html/body/items/item/name/@value')[item].to_s,
18
+ 'image' => recent_favourites.xpath('//html/body/items/item/thumbnail/@value')[item].to_s,
19
+ 'item_id' => recent_favourites.xpath('//html/body/items/item/@id')[item].to_s,
20
+ 'item_link' => item_link
21
+ }
22
+ popular_games.append(game_dict)
23
+ end
24
+ #puts popular_games.length.to_s
25
+ #indItem = Nokogiri::HTML(doc.xpath('//html/body/items/item')[0])
26
+ return popular_games
22
27
  end
23
- #puts popular_games.length.to_s
24
- #indItem = Nokogiri::HTML(doc.xpath('//html/body/items/item')[0])
25
- return popular_games
26
28
  end
27
29
  end
28
30
 
29
31
 
30
32
 
31
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tablehop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liam duggan