diff --git a/README.md b/README.md index 4bbba52..6676a23 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Book status for profile README +# Book status for profile README This project provides a badge for sharing your current book in your github profile. @@ -9,4 +9,16 @@ This project provides a badge for sharing your current book in your github profi It is heavily inspired by [spotify-readme](https://github.com/novatorem/spotify-readme). -Install instructions are available [here](https://github.com/thefr1nge/goodreads-readme/blob/master/SetUp.md). +## Set Up Guide + +- Go to your goodreads profile (on your PC). +- Next to "Your recent updates" there is an hyperlink called **rss** +- Note down the 8 digit integer in the ending of the URL's path section +- Add the following into the readme file, replacing the parameter with the id + you noted down. + +``` +

I am currently reading:

+GoodReads reading +``` + diff --git a/SetUp.md b/SetUp.md deleted file mode 100644 index bb5169f..0000000 --- a/SetUp.md +++ /dev/null @@ -1,16 +0,0 @@ -# Set Up Guide -You must fork this repository first to create a Vercel project. - -## Goodreads - -- Go to your goodreads profile (on your PC). -- Next to "Your recent updates" there is an hyperlink called **rss** - -## Vercel - -* Register on [Vercel](https://vercel.com/) -* Create project linked to your github repo -* Add System Variable: - * `https://vercel.com///settings/environment-variables` - * `GOODREADS_RSS_URL` -* Deploy! diff --git a/api/book.py b/api/book.py index c011f4e..ae308ee 100644 --- a/api/book.py +++ b/api/book.py @@ -1,4 +1,4 @@ -from flask import Flask, Response, jsonify, render_template +from flask import Flask, Response, jsonify, render_template, request from base64 import b64encode import feedparser import re @@ -11,7 +11,6 @@ import json import os import random -GOODREADS_RSS_URL = os.getenv("GOODREADS_RSS_URL") PROGRESS_REGEX = r".*\"([^\"]*)") def last_activity(path): - activityFeed = feedparser.parse(GOODREADS_RSS_URL) + goodread_rss_url = f'https://www.goodreads.com/user/updates_rss/{request.args.get("id")}' + print(goodread_rss_url) + activityFeed = feedparser.parse(goodread_rss_url) data = "" entries = activityFeed.entries pr = re.compile(PROGRESS_REGEX)