Skip to content

Commit

Permalink
fixes for new patreon version. closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Oct 27, 2019
1 parent a047727 commit 91b5eab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ const server = http.createServer(async (request, response) => {
const { data } = await httpie.get('https://patreon.com/' + username);
const { document } = (new JSDOM(data)).window;

const pledges = document.querySelectorAll('h2.sc-bZQynM.izRyKA');
const message = (usePledges)
? pledges[1].innerHTML + "/mo"
: pledges[0].innerHTML + " patrons";
? document.querySelector('[data-tag="CampaignPatronEarningStats-earnings"] h2').innerHTML + "/mo"
: document.querySelector('[data-tag="CampaignPatronEarningStats-patron-count"] h2').innerHTML + " patrons";

const res = {
schemaVersion: 1,
Expand Down

0 comments on commit 91b5eab

Please sign in to comment.