Giter VIP home page Giter VIP logo

mybgg's Introduction

MyBGG - Search and filter your boardgame collection

This project is meant to be forked. The original project is available here: https://github.com/EmilStenstrom/mybgg

Using this project, you can set up your own site for searching and filtering your boardgame collection. As an example, have a look at this: https://games.emilstenstrom.se

Site preview

Requirements

  • GitHub account (free). We will serve the site using GitHub Pages.
  • Boardgamegeek account (free). We will fetch all your games and game metadata from here.
  • Algolia account (free). Used for creating and searching with lightning speed.
  • Computer (not free) with Python 3.6+ installed.

Getting your own site up and running the first time

  1. Fork this project (EmilStenstrom/mybgg) to your own GitHub account.

    Details Forking a project is pretty much copying it to your own GitHub account. On the top of this page, to the right, is a button called Fork. Click it and accept all the defaults. You now have a copy of this project you can make changes to.
  2. Update the config.json-file with your account details for Boardgamegeek and Algolia. Commit and push this file to your forked repository.

    Details
    • To change a file in your project, you first need to get it working on your computer. You get it from GitHub to your computer by cloning it. Go to your forked project, and find the green "Clone or download"-button. If you know how Git works, you can clone it by typing git clone YOUR_GIT_URL. Otherwise downloading the zip-file, and unzipping it to a directory works fine too.
    • Now go into the directory that you just created, and edit the file called config.json.
    {
        "project": {
            "name": "mybgg",  // This is the name of your project. You can leave it as it is.
            "title": ""  // This is the page title. If you leave this empty, a title will be
                         // created from your BGG username.
        },
        "boardgamegeek": {
            "user_name": "YOUR_BGG_USERNAME",  // The username on boardgamegeek that has your games
            "extra_params": {
                "own": 1  // Here's the query that will be sent to BGG to get your games. A full list
                          // of options can be found here:
                          // https://lcosmin.github.io/boardgamegeek/modules.html#boardgamegeek.api.BGGClient.collection
            }
        },
        "algolia": {
            "app_id": "YOUR_APP_ID",  // Your Algolia APP ID. When logged in, look at the top of the
                                      // page which says: APPS > YOUR_ID_HERE
            "api_key_search_only": "YOUR_PUBLIC_API_KEY",  // Click "API Keys" in the menu to the left.
                                                           // Use the "Search-Only API Key"!
            "index_name": "YOUR_INDEX_NAME",  // All your games will be stored in something called an "index".
                                              // You can create and index by going to "Indices" in the menu to the left.
                                              // Click to create a new index, and give it a name. Put the name you choose here.
            "hits_per_page": 48,  // Number of games you want to show on each page
            "sort_by": "asc(name)"  // Default sort order before the user has searched for anything.
                                    // Can be one of: asc(rank), desc(rating), desc(numrated), desc(numowned)
                                    // "asc" stands for ascending, meaning lowest number first, desc the opposite
        }
    }
    • Your're all set. If you cloned your project from github, you can commit your change by typing:
    git commit -m "Update config.json"
    git push
    
  3. Install the python libraries needed by running:
    pip install -r scripts/requirements.txt

    Details
    • This step requires that you have (at least) Python 3.6 installed. You can download it from https://python.org if you need to.
    • The installer installs a command called "pip", that allows you to install libraries from the internet. It could be called "pip3.6" instead, so try typing that instead of pip if you don't get it working.
    • The mybgg project comes with a requirements.txt file, that specifies which version of things it needs. So go to the project, and type the above command there. Everything you need should be installed.
  4. Download your games from boardgamegeek and send them to algolia:
    python scripts/download_and_index.py --apikey YOUR_ALGOLIA_ADMIN_API_KEY

    (Note that this API KEY is NOT the same as the one you put in config.json. Never share your admin api key publicly)

    Details
    • This step requires that you have (at least) Python 3.6 installed. You can download it from https://python.org if you need to.
    • Python could be installed as either "python", or "python3.6". Try the other version if the first doesn't work for you. You'll probably get "Invalid syntax"-errors if you run the script with the wrong version.
    • The Algolia API key needed here can be found under the "API Keys" menu option, when logged in to Algolias dashboard. Pick the one called "Admin API Key", since this one will need permission to add games to your index. Never share this key publicly, since it can be used to delete your whole search index. Don't commit it to your project!
    • Running this command might give strange errors from time to time. It seems the boardgamegeek API is somewhat shaking. Just trying to run the command again usually works. If you get other errors, please post an issue here: https://github.com/EmilStenstrom/mybgg/issues
  5. Enable GitHub Pages on your forked repository by going into Settings -> GitHub Pages. Select your master branch as Source, and click Save.

  6. Your site is now available on (https://YOUR_GITHUB_USERNAME.github.io/mybgg)

Working on your site locally

  1. Go to your project directory. Run this command:

    python -m http.server

    This starts a webserver in the directory you're in.

  2. Open your web browser and go to http://localhost:8000. VoliΓ‘! Any time you make a change to your project you can just reload the page to see your changes applied. When you're happy with the result, commit your changes.

Updating your project to the latest version when mybgg is updated

  1. Add a connection between your forked project, and the mybgg project. We will use this "connection", or remote, to fetch the latest version. You only need to do this the first time.

    git remote add upstream https://github.com/EmilStenstrom/mybgg.git
    
  2. Fetch the latest changes from the mybgg project:

    git fetch upstream
    
  3. Merge the changes you fetched with the changes you made to your project locally:

    git merge upstream/master
    
  4. Update to the latest version of all external libraries that mybgg uses internally. They can update between versions.

    pip install -r scripts/requirements.txt
    
  5. Push the new updated version to GitHub:

    git push
    

Projects used under the hood

mybgg's People

Contributors

akelley avatar aloisdg avatar dependabot[bot] avatar emilstenstrom avatar fzerorubigd avatar jsund avatar matyifkbt avatar michaelthomasmpt avatar respencer avatar thatcasualmatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mybgg's Issues

Ability to include expansions?

I wanted to include the expansions I have for games in the returned collection. But after trying to configure the config boardgamegeek object i wasn't able to figure out where to add it. Looking at the API page - https://lcosmin.github.io/boardgamegeek/modules.html#boardgamegeek.api.BGGClient.collection - it looks like it should be possible via subtype, but i could not get a successful call with the subtype attribute.

  "boardgamegeek": {
        "user_name": "####",
        "subtype": "boardgame,boardgameexpansion",
        "extra_params": {
            "own": 1
        }
    },

Moving filters back to the right side

The current filters at the top of the screen are difficult to use on Android with Firefox. You have to drag your thumb over the filters because they dont all appear at once. The previous way they were all at your fingertips to pick and choose easily. Is there a setting to change this back or should I roll back to that version to get that functionality restored?

UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images

Ran into this issue when updating my collecton today.

E:\Python37-32\lib\site-packages\PIL\Image.py:932: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
"Palette images with Transparency expressed in bytes should be "

Rerunning with --debug.

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cf.geekdo-images.com:443
DEBUG:urllib3.connectionpool:https://cf.geekdo-images.com:443 "GET /thumb/img/Jcx2vf4RYzRyfhLS_usOe74hNpA=/fit-in/200x150/pic4309072.png HTTP/1.1" 200 7100
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'PLTE' 41 768
DEBUG:PIL.PngImagePlugin:STREAM b'tRNS' 821 256
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 1089 5995
E:\Python37-32\lib\site-packages\PIL\Image.py:932: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
"Palette images with Transparency expressed in bytes should be "

Issue with adding game to collection, objectID=bgg150997 is too big size=10763/10000 bytes

My guess is it has too many expansions
https://boardgamegeek.com/boardgame/150997/shadows-brimstone-swamps-death

Traceback (most recent call last):
File "E:\mybgg\scripts\download_and_index.py", line 77, in
main(args)
File "E:\mybgg\scripts\download_and_index.py", line 34, in main
indexer.add_objects(collection)
File "E:\mybgg\scripts\mybgg\indexer.py", line 226, in add_objects
self.index.save_objects(games)
File "E:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\algoliasearch\search_index.py", line 72, in save_objects
response = self._chunk("updateObject", objects, request_options)
File "E:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\algoliasearch\search_index.py", line 527, in _chunk
raw_responses.append(self._raw_batch(requests, request_options))
File "E:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\algoliasearch\search_index.py", line 534, in _raw_batch
return self._transporter.write(
File "E:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\algoliasearch\http\transporter.py", line 35, in write
return self.request(verb, hosts, path, data, request_options, timeout)
File "E:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\algoliasearch\http\transporter.py", line 72, in request
return self.retry(hosts, request, relative_url)
File "E:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\algoliasearch\http\transporter.py", line 92, in retry
raise RequestException(content, response.status_code)
algoliasearch.exceptions.RequestException: Record at the position 401 objectID=bgg150997 is too big size=10763/10000 bytes. Please have a look at https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/in-depth/index-and-records-size-and-usage-limitations/#record-size-limits

Changes on BGG are not applied

This may be an error on my behalf but I set up my site first and then updated my BGG-account. But these changes don't show on the active mybgg page. How do I update it with the latest changes from bgg?

ModuleNotFoundError: No module named 'declxml'

Probably some sort of configuration issue on my part. I havent updated my games in a while. I pulled the latest and declxml is in the requirements.txt file.
declxml==1.1.3 # via -r scripts/requirements.in

Installing the requirements says decl.xml is up to date
Requirement already satisfied: declxml==1.1.3 in e:\users\user\appdata\local\programs\python\python36-32\lib\site-packages (from -r scripts/requirements.txt (line 11))

Traceback (most recent call last):
  File "e:\Users\User\Documents\mybgg-git\mybgg\scripts\download_and_index.py", line 3, in <module>
    from mybgg.downloader import Downloader
  File "e:\Users\User\Documents\mybgg-git\mybgg\scripts\mybgg\downloader.py", line 1, in <module>
    from mybgg.bgg_client import BGGClient
  File "e:\Users\User\Documents\mybgg-git\mybgg\scripts\mybgg\bgg_client.py", line 5, in <module>
    import declxml as xml
ModuleNotFoundError: No module named 'declxml'

Not sure what I am missing here or how to get it to find the package

Table tooltips do not respect screen width

I never had this issue with the old version of mybgg layout, and only noticed it recently.

The column width (number of games horizontally) in the tables respects the browser window and self adjust, but the tooltips for each game do not. Clicking on an item at the rightmost side of the table will force the tooltip offscreen. You can manually scroll over more to see it, but this tooltip should probably respect the same width rules the table itself is using.

I know the old versions (2+ years ago) of mybgg did not have this issue.

chrome_2021-10-21_19-55-20

Getting this error when trying to import a big collection

I'm trying to create a collection for one of my BG buddies https://boardgamegeek.com/user/kinkymachine

Getting this error

Imported 99 games from boardgamegeek.
Traceback (most recent call last):
  File "download_and_index.py", line 273, in <module>
    main(args)
  File "download_and_index.py", line 244, in main
    indexer.add_objects(collection)
  File "download_and_index.py", line 214, in add_objects
    self.index.add_objects(games)
  File "/usr/local/lib/python3.6/site-packages/algoliasearch/index.py", line 119, in add_objects
    return self.batch(requests, request_options=request_options)
  File "/usr/local/lib/python3.6/site-packages/algoliasearch/index.py", line 1025, in batch
    return self._req(False, '/batch', 'POST', request_options, data=requests)
  File "/usr/local/lib/python3.6/site-packages/algoliasearch/index.py", line 1128, in _req
    return self.client._req(is_search, path, meth, request_options, params, data)
  File "/usr/local/lib/python3.6/site-packages/algoliasearch/client.py", line 697, in _req
    return self._transport.req(is_search, path, meth, params, data, request_options)
  File "/usr/local/lib/python3.6/site-packages/algoliasearch/transport.py", line 176, in req
    raise e
  File "/usr/local/lib/python3.6/site-packages/algoliasearch/transport.py", line 174, in req
    return r(host, path, meth, timeout, params, data, headers)
  File "/usr/local/lib/python3.6/site-packages/algoliasearch/transport.py", line 120, in _session_req
    raise AlgoliaException(message)
algoliasearch.helpers.AlgoliaException: Record at the position 46 objectID=bgg699 is too big size=10770 bytes. Contact us if you need an extended quota

Sorting

Any way to set sorting of games?

I would like to set it by number of ratings. To show most attractive games first.

code organization suggestion

This more of an suggestion than a real issue.
It would be nice if html/web code is in a separate folder (say: www), which would make uploading to hosting of our choice easier.
Or, if you prefer supporting hosting this in people's github hosting, move the non-www code to some /scripts or similar folder.

In the current state, I need to guess/remember which files need to be uploaded.

Thanks ;)

Ability to include pre-ordered and want to buy?

This is probably only really specific to me, but I wanted to use this so my group and I can keep track of the games we have pre-ordered and what games we're interested in getting as well. How would I go about adding those options? I don't have much experience or skill with this stuff, so I don't really know where to even begin.

Updating collection

I updated my bgg collection, but it still pull the old list before updating. I asume that is a cache issue somewhere, but is it possible to make it update itself somehow?

Error when running scripts/download_and_index.py

Python 3.7.0


python3 scripts/download_and_index.py --apikey MYKEY

Traceback (most recent call last):
  File "scripts/download_and_index.py", line 3, in <module>
    from mybgg.downloader import Downloader
  File "/Users/lajlev/Sites/mybgg/scripts/mybgg/downloader.py", line 1, in <module>
    from mybgg.bgg_client import BGGClient
  File "/Users/lajlev/Sites/mybgg/scripts/mybgg/bgg_client.py", line 5, in <module>
    import declxml as xml
ModuleNotFoundError: No module named 'declxml'

Any clue?

Issue with this working on mobile devices

Having trouble narrowing this down but I'm going to assume it has to do with Algolia or the stylesheet and device screen resolution, but I can't get my custom site to work on mobile. All I see is the Algolia placeholder in chrome (and firefox) on both my phones. The exact same thing happens in Bluestacks, as well.

It works fine on my old 1920x1080 Samsung tablet. Everything is on the same network when testing.

download_and_index.py errors

python scripts/download_and_index.py --apikey XXXX

Traceback (most recent call last):
File "scripts/download_and_index.py", line 77, in
main(args)
File "scripts/download_and_index.py", line 8, in main
SETTINGS = json.load(open("config.json", "rb"))
File "\Python\Python36-32\lib\json_init_.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "\Python\Python36-32\lib\json_init_.py", line 354, in loads
return _default_decoder.decode(s)
File "\Python\Python36-32\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "\Python\Python36-32\lib\json\decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 16 column 3 (char 374)

Issue pulling down games from bgg

Traceback
Traceback (most recent call last):
File "scripts/download_and_index.py", line 78, in
main(args)
File "scripts/download_and_index.py", line 17, in main
extra_params=SETTINGS["boardgamegeek"]["extra_params"],
File "D:\mybggnew\mybgg\scripts\mybgg\downloader.py", line 36, in collection
game_list_data = self.client.game_list([game_in_collection["id"] for game_in_collection in collection_data])
File "D:\mybggnew\mybgg\scripts\mybgg\bgg_client.py", line 43, in game_list
games += self._games_list_to_games(data)
File "D:\mybggnew\mybgg\scripts\mybgg\bgg_client.py", line 235, in _games_list_to_games
games = xml.parse_from_string(game_processor, data)
File "E:\Python37-32\lib\site-packages\declxml.py", line 311, in parse_from_string
return root_processor.parse_at_root(root, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 972, in parse_at_root
parsed_dict = self.parse_at_element(dict_element, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 956, in parse_at_element
parsed_dict[child.alias] = child.parse_from_parent(element, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 823, in parse_from_parent
return self._parse(item_iter, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 880, in _parse
parsed_array.append(self._item_processor.parse_at_element(item, state))
File "E:\Python37-32\lib\site-packages\declxml.py", line 1085, in parse_at_element
xml_value = self._processor.parse_at_element(element, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 956, in parse_at_element
parsed_dict[child.alias] = child.parse_from_parent(element, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 1227, in parse_from_parent
MissingValue, 'Missing required element "{}"'.format(self.element_path)
File "E:\Python37-32\lib\site-packages\declxml.py", line 1369, in raise_error
raise exception_type(error_message)
declxml.MissingValue: Missing required element "statistics/ratings/ranks/rank[@friendlyname='Board Game Rank']" at items/item[16]/statistics/ratings/ranks/rank[@friendlyname='Board Game Rank']

Traceback with debug flag
DEBUG:mybgg.bgg_client:Successfully parsed: Nothing Personal Expansion Pack #3: Movies and TV (id: 181500).
DEBUG:mybgg.bgg_client:Successfully parsed: Nothing Personal: Associates (id: 158202).
DEBUG:mybgg.bgg_client:Successfully parsed: Nothing Personal: Power & Influence (id: 157488).
Traceback (most recent call last):
File "scripts/download_and_index.py", line 78, in
main(args)
File "scripts/download_and_index.py", line 17, in main
extra_params=SETTINGS["boardgamegeek"]["extra_params"],
File "D:\mybggnew\mybgg\scripts\mybgg\downloader.py", line 36, in collection
game_list_data = self.client.game_list([game_in_collection["id"] for game_in_collection in collection_data])
File "D:\mybggnew\mybgg\scripts\mybgg\bgg_client.py", line 43, in game_list
games += self._games_list_to_games(data)
File "D:\mybggnew\mybgg\scripts\mybgg\bgg_client.py", line 235, in _games_list_to_games
games = xml.parse_from_string(game_processor, data)
File "E:\Python37-32\lib\site-packages\declxml.py", line 311, in parse_from_string
return root_processor.parse_at_root(root, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 972, in parse_at_root
parsed_dict = self.parse_at_element(dict_element, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 956, in parse_at_element
parsed_dict[child.alias] = child.parse_from_parent(element, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 823, in parse_from_parent
return self._parse(item_iter, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 880, in _parse
parsed_array.append(self._item_processor.parse_at_element(item, state))
File "E:\Python37-32\lib\site-packages\declxml.py", line 1085, in parse_at_element
xml_value = self._processor.parse_at_element(element, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 956, in parse_at_element
parsed_dict[child.alias] = child.parse_from_parent(element, state)
File "E:\Python37-32\lib\site-packages\declxml.py", line 1227, in parse_from_parent
MissingValue, 'Missing required element "{}"'.format(self.element_path)
File "E:\Python37-32\lib\site-packages\declxml.py", line 1369, in raise_error
raise exception_type(error_message)
declxml.MissingValue: Missing required element "statistics/ratings/ranks/rank[@friendlyname='Board Game Rank']" at items/item[15]/statistics/ratings/ranks/rank[@friendlyname='Board Game Rank']

How did you make one request instead of one per game?

Hello! Not an issue for your repo, but a question. πŸ˜ƒ

I came across your Reddit thread as I'm trying to get around the BGG rate limiting and am very curious to know how you made one request for all games instead of one per game.

I'm trying to implement this enhancement request in my app and have been banging my head trying to figure out how to work around BGG's rate limiting.

I even posted a question on Stack Overflow to no avail... πŸ˜…

If you could at least guide me to where you did this in your code, I'd be very appreciative! πŸ™

Is there a way to change back to the old board game backgrounds?

If an image was too small the background of a game used to be a blurred out version of the cover. Is there a way to put this back in or turn it back on? The current patchwork of randomly colored squares behind the titles seems like a big step backwards in viewing a collection.

Invalid syntax

I get invalid syntax when I run python download_and_index.py --apikey MYADMINKEY

sceenshot

KeyError 'best' in numplayers_to_result

Hello,

I'm getting a KeyError on the 'best' key for result in line 120 of bgg_client.py. Stack trace is at the bottom.

SHA of your commit: aad8aee

I didn't inspect the rest of the code, but I suspect some games with 0 votes for best at # just don't generate that entry. I resolved it locally for myself by adding a try-except KeyError around the is_recommended, but that's probably not the best formal fix.

Additionally it seems that the existence of 'best' and 'recommended' can't be guaranteed (tried the except block without 'best' but still got a key error on 'recommended')

Traceback (most recent call last):
  File "download_and_index.py", line 75, in <module>
    main(args)
  File "download_and_index.py", line 17, in main
    extra_params=SETTINGS["boardgamegeek"]["extra_params"],
  File "/home/jsierra/mybgg/mybgg/downloader.py", line 37, in collection
    [game_in_collection["id"] for game_in_collection in collection_data]
  File "/home/jsierra/mybgg/mybgg/bgg_client.py", line 43, in game_list
    games += self._games_list_to_games(data)
  File "/home/jsierra/mybgg/mybgg/bgg_client.py", line 211, in _games_list_to_games
    games = xml.parse_from_string(game_processor, data)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 203, in parse_from_string
    return root_processor.parse_at_root(root, state)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 681, in parse_at_root
    parsed_dict = self.parse_at_element(dict_element, state)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 666, in parse_at_element
    parsed_dict[child.alias] = child.parse_from_parent(element, state)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 584, in parse_from_parent
    return self._parse(item_iter, state)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 625, in _parse
    parsed_array.append(self._item_processor.parse_at_element(item, state))
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 666, in parse_at_element
    parsed_dict[child.alias] = child.parse_from_parent(element, state)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 746, in parse_from_parent
    xml_value = self._processor.parse_from_parent(parent, state)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 584, in parse_from_parent
    return self._parse(item_iter, state)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 625, in _parse
    parsed_array.append(self._item_processor.parse_at_element(item, state))
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 666, in parse_at_element
    parsed_dict[child.alias] = child.parse_from_parent(element, state)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 747, in parse_from_parent
    return _hooks_apply_after_parse(self._hooks, state, xml_value)
  File "/tools/python/versions/3.7.0/lib/python3.7/site-packages/declxml.py", line 1033, in _hooks_apply_after_parse
    return hooks.after_parse(ProcessorStateView(state), value)
  File "/home/jsierra/mybgg/mybgg/bgg_client.py", line 120, in numplayers_to_result
    is_recommended = result['best'] + result['recommended'] > result['not_recommended']
KeyError: 'best'

Replace Algolia with lunr.js

This would simplify setup and deployment greatly, although it would be a big change to the architecture of this project.

BGG throttling the public API?

Haven't updated my library in a while. Just tried earlier (once) and the script was kicking back an HTTP 429.
Heading directly to the link shows some sort of throttling enabled. I've used mybgg for years and never seen this one:

I'll try again tomorrow to manually hit the link and see if it works. If it does, I'll try the script again and see if it is triggering the throttle.

chrome_2022-07-17_01-51-01
.

error fetching BGG API response: non-XML reply

When I tried use it for a boardgame cafe in copenhagen https://boardgamegeek.com/user/BastardCafe

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/boardgamegeek/utils.py", line 337, in request_and_parse_xml
    raise BGGApiError("non-XML reply")
boardgamegeek.exceptions.BGGApiError: non-XML reply

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "download_and_index.py", line 296, in <module>
    main(args)
  File "download_and_index.py", line 254, in main
    extra_params=SETTINGS["boardgamegeek"]["extra_params"],
  File "download_and_index.py", line 108, in collection
    [game_in_collection.id for game_in_collection in collection]
  File "/usr/local/lib/python3.6/site-packages/boardgamegeek/api.py", line 797, in game_list
    retry_delay=self._retry_delay)
  File "/usr/local/lib/python3.6/site-packages/boardgamegeek/utils.py", line 367, in request_and_parse_xml
    raise BGGApiError("error fetching BGG API response: {}".format(e))
boardgamegeek.exceptions.BGGApiError: error fetching BGG API response: non-XML reply

Feature Request: Add a filter-by-minimum-recommended-age (listed, community)

BGG advanced search ([https://boardgamegeek.com/advsearch/boardgame]) includes a minimum-age option, which returns titles at the listed minimum (i.e. 8+). Looking at a game detail page, it appears that there's a community-recommended minimum as well.

As someone in a tabletop family with younger nieces and nephews, I'd like to be able to quickly suggest titles from my collection that would be easier to start with.

Game descriptions getting truncated by a colon?

I've noticed that every boardgame in my collection that has its description (imported directly from BGG) beginning with "Game description from the publisher:" gets the description cut off. This is only happening for those titles. There's a lot of titles that have this prefix in their boardgamegeek descriptions, and they're all getting cut off.

I'm using the latest version (merged this morning) and am not sure if I've noticed this before.

Example: https://i.imgur.com/E4I7qzN.jpg

Number of items per page

Site looks weird in iPad because there is 20 items per page, and on iPad, you see just three columns. It would be better if number of items per page was 24, which is divisible by 2, 3 and 4 - which would fit for all widths.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.