From 1e7c883b6a48e25db5e14d2cddc194d7e17b7ff7 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sat, 13 Mar 2021 18:36:42 +0100 Subject: [PATCH] Daily commit --- data/ladbrokes-questions.json | 124 +++++++++++++++++----------------- src/ladbrokes-fetch.js | 8 ++- 2 files changed, 67 insertions(+), 65 deletions(-) diff --git a/data/ladbrokes-questions.json b/data/ladbrokes-questions.json index b829c97..2bbc048 100644 --- a/data/ladbrokes-questions.json +++ b/data/ladbrokes-questions.json @@ -1,7 +1,7 @@ [ { "title": "2024 US Presidential Election: 2024 Election Winner", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -429,7 +429,7 @@ }, { "title": "2024 US Presidential Election: 2024 Republican Nominee", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -652,7 +652,7 @@ }, { "title": "2024 US Presidential Election: 2024 Democratic Nominee", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -770,7 +770,7 @@ }, { "title": "2024 US Presidential Election: Winning Party", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -793,7 +793,7 @@ }, { "title": "2024 US Presidential Election: Republican Ticket (Nominee + VP)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -856,7 +856,7 @@ }, { "title": "Next German Chancellor: To Replace Merkel As Chancellor", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -899,7 +899,7 @@ }, { "title": "Next French Presidential Election: To Win", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -987,7 +987,7 @@ }, { "title": "2022 Texas Gubernatorial Election: To Win", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1015,7 +1015,7 @@ }, { "title": "2021 German Federal Election: Most Seats", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1043,7 +1043,7 @@ }, { "title": "2021 NYC Mayoral Election: Election Winner - Void if no 2021 election", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1096,7 +1096,7 @@ }, { "title": "Tees Valley Mayoral Election: To Win", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1114,7 +1114,7 @@ }, { "title": "Next Labour Party Leader: To Succeed Keir Starmer", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1402,7 +1402,7 @@ }, { "title": "Next Labour Party Leader: When will Keir Starmer be replaced as Labour Party leader?", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1430,7 +1430,7 @@ }, { "title": "Next UK Prime Minister: Next PM (Acting PM or similar will not count)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1748,7 +1748,7 @@ }, { "title": "West Yorkshire Mayoral Election: 2021 Election Winner (Void if no 2021 election)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1781,7 +1781,7 @@ }, { "title": "London Mayoral Election: 2021 Election Winner (Void if no 2021 election)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1874,7 +1874,7 @@ }, { "title": "London Mayoral Election: Sadiq Khan R1 Vote Share", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1907,7 +1907,7 @@ }, { "title": "London Mayoral Election: Winner without Sadiq Khan", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1960,7 +1960,7 @@ }, { "title": "London Mayoral Election: Most votes match bet", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -1977,8 +1977,8 @@ "stars": 2 }, { - "title": "Boris Johnson Specials: When will Johnson be replaced as PM? (1st Instance Only)", - "url": "https://sports.ladbrokes.com/event/politics/", + "title": "Boris Johnson: When will Johnson be replaced as PM? (1st Instance Only)", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2000,8 +2000,8 @@ "stars": 2 }, { - "title": "Boris Johnson Specials: Leader at Next General Election?", - "url": "https://sports.ladbrokes.com/event/politics/", + "title": "Boris Johnson: Leader at Next General Election?", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2019,7 +2019,7 @@ }, { "title": "2021 Welsh Assembly Elections: Most Seats", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2047,7 +2047,7 @@ }, { "title": "2021 Welsh Assembly Elections: Majority Betting (over 30 Seats)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2065,7 +2065,7 @@ }, { "title": "Next Scottish Independence Referendum: Year Of Next Official Referendum (Sanctioned by UK and Scottish Governments)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2098,7 +2098,7 @@ }, { "title": "Next UK General Election: Most Seats", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2131,7 +2131,7 @@ }, { "title": "Next UK General Election: Year of next election", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2159,7 +2159,7 @@ }, { "title": "Next UK General Election: Overall Majority", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2182,7 +2182,7 @@ }, { "title": "Next Scottish First Minister: Next Scottish First Minister", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2360,7 +2360,7 @@ }, { "title": "Next Scottish Parliamentary Election: Most Seats", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2398,7 +2398,7 @@ }, { "title": "Next Scottish Parliamentary Election: Majority Betting", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2416,7 +2416,7 @@ }, { "title": "Next Scottish Parliamentary Election: Most Seats - Second Place", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2449,7 +2449,7 @@ }, { "title": "Next Scottish Parliamentary Election: SNP Constituency Vote Share", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2487,7 +2487,7 @@ }, { "title": "Next Scottish Parliamentary Election: Will Nicola Sturgeon be First Minister on 1st Jan 2022?", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2505,7 +2505,7 @@ }, { "title": "Next Scottish Parliamentary Election: SNP Total Seats Over/Under", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2523,7 +2523,7 @@ }, { "title": "Next Scottish Parliamentary Election: Edinburgh Central", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2556,7 +2556,7 @@ }, { "title": "Greater Manchester Mayoral Election: 2021 Election Winner (Void if no 2021 election)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2589,7 +2589,7 @@ }, { "title": "Next Conservative Party Leader: Next Permanent Leader", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2932,7 +2932,7 @@ }, { "title": "West Midlands Mayoral Election: 2021 Election Winner (Void if no 2021 election)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": [ { @@ -2960,7 +2960,7 @@ }, { "title": "Biden to leave office in 1st term via Impeachment, Resignation or 25th Amendment", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -2978,7 +2978,7 @@ }, { "title": "Biden to serve full 1st term", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -2996,7 +2996,7 @@ }, { "title": "2024 US Presidential Election: Donald Trump to be elected President as a third party candidate", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3014,7 +3014,7 @@ }, { "title": "2024 US Presidential Election: Donald Trump to run and win with over 75% of popular vote", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3032,7 +3032,7 @@ }, { "title": "London Mayoral Election: Sadiq Khan NOT to win", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3050,7 +3050,7 @@ }, { "title": "London Mayoral Election: Brian Rose to get over 5% of vote", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3068,7 +3068,7 @@ }, { "title": "London Mayoral Election: Shaun Bailey to get under 25% of R1 Vote", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3086,7 +3086,7 @@ }, { "title": "London Mayoral Election: Laurence Fox to get over 5% of vote", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3104,7 +3104,7 @@ }, { "title": "Next UK General Election: Conservatives to increase their majority from 2019 (80 seats)", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3122,7 +3122,7 @@ }, { "title": "Next UK General Election: Conservatives Do Not Win Most Seats", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3140,7 +3140,7 @@ }, { "title": "Next UK General Election: Conservatives fail to win a majority", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3158,7 +3158,7 @@ }, { "title": "Next UK General Election: Lib Dems to win over 25 seats", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3176,7 +3176,7 @@ }, { "title": "Dehenna Davison to become UK PM before 2060", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3194,7 +3194,7 @@ }, { "title": "UK to rejoin EU before end 2025", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3212,7 +3212,7 @@ }, { "title": "Rishi Sunak to become PM before next general election", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3230,7 +3230,7 @@ }, { "title": "David Lammy to be UK PM before end 2040", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3248,7 +3248,7 @@ }, { "title": "Marcus Rashford To Become Uk Pm Before 2060", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3266,7 +3266,7 @@ }, { "title": "Libertarian Party to win US Presidential election before 2041", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3284,7 +3284,7 @@ }, { "title": "Nigel Farage to become UK PM in 2021", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3302,7 +3302,7 @@ }, { "title": "Amanda Gorman to be elected US President in 2036", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3320,7 +3320,7 @@ }, { "title": "Marcus Rashford to become a UK MP before 2060", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { @@ -3338,7 +3338,7 @@ }, { "title": "Piers Morgan to become PM before 2040", - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ { diff --git a/src/ladbrokes-fetch.js b/src/ladbrokes-fetch.js index eb08e57..8419d8d 100644 --- a/src/ladbrokes-fetch.js +++ b/src/ladbrokes-fetch.js @@ -45,9 +45,10 @@ let processResults = async (json) => { for(let normalMarket of normalMarkets){ let title = normalMarket.parent + ": " + normalMarket.name + title = title.replace("Boris Johnson Specials", "Boris Johnson") // small kludge let options = normalMarket.children.map(child => { let name = child.outcome.name - name = name.replace("Boris Johnson Specials", "Boris Johnson") // small kludge + let priceData = child.outcome.children[0].price let priceDecimal = Number(priceData.priceDec) let probability = 1/priceDecimal @@ -73,7 +74,7 @@ let processResults = async (json) => { let obj = ({ "title": title, - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "Ladbrokes", "options": options, "stars": calculateStars("Ladbrokes", ({})) @@ -88,12 +89,13 @@ let processResults = async (json) => { //console.log(title) specialMarket.children.forEach(child => { let name = specialMarket.parent.includes("Specials")? child.outcome.name : specialMarket.parent + ": " + child.outcome.name + name = name.replace("Boris Johnson Specials", "Boris Johnson") // small kludge let priceData = child.outcome.children[0].price let priceDecimal = Number(priceData.priceDec) let probability = 1/priceDecimal let obj = ({ "title": name, - "url": "https://sports.ladbrokes.com/event/politics/", + "url": "https://sports.ladbrokes.com/sport/politics/outrights", "platform": "LadBrokes", "options": [ {