diff --git a/main.js b/main.js index 6e3d120..7c5e0b6 100644 --- a/main.js +++ b/main.js @@ -1,42 +1,50 @@ const axios = require('axios'); const cheerio = require('cheerio'); +// Update the Match URL Don't remove this line - https://cors-anywhere.herokuapp.com/ const liveurl = 'https://cors-anywhere.herokuapp.com/https://www.espncricinfo.com/series/8048/game/1216492/mumbai-indians-vs-chennai-super-kings-1st-match-indian-premier-league-2020-21'; +function Getscore() { // eslint-disable-next-line no-undef -const appNotice = $('.notice'); -appNotice.html('
Fetching the Live Score 📦
'); + const appNotice = $('.notice'); + appNotice.html('Fetching the Live Score 📦
'); -axios({ - method: 'get', - url: liveurl, -}) - .then( - setTimeout(() => { - appNotice.empty(); - }, 800), - ) - .then(function(response) { - if (response.status == '200') { - const html = response.data; - const $ = cheerio.load(html); - let score = $('meta[property="og:title"]').attr('content'); - console.log(score); - document.getElementById('response').innerHTML = 'Fetching the Live Score 📦
'); + const appNotice = $('.notice'); + appNotice.html('Fetching the Live Score 📦
'); -axios({ - method: 'get', - url: liveurl, -}) - .then( - setTimeout(() => { - appNotice.empty(); - }, 800), - ) - .then(function(response) { - if (response.status == '200') { - const html = response.data; - const $ = cheerio.load(html); - let score = $('meta[property="og:title"]').attr('content'); - console.log(score); - document.getElementById('response').innerHTML = 'a&&(n=a)):n=a;var o=t.length;n>o/2&&(n=o/2);for(var s=0,l;s t&&(e+=" ... ")," o?void 0:s,o=1),t=Object(t);++a c))return!1;var _=l.get(e);if(_&&l.get(t))return _==t;var u=-1,m=!0,T=2&o?new r:void 0;for(l.set(e,t),l.set(t,e);++u e.seen.indexOf(p.value)?(i=E(r)?l(e,p.value,null):l(e,p.value,r-1),-1 a&&(n=a)):n=a;var o=t.length;n>o/2&&(n=o/2);for(var s=0,l;s t&&(e+=" ... ")," o?void 0:s,o=1),t=Object(t);++a c))return!1;var _=l.get(e);if(_&&l.get(t))return _==t;var u=-1,m=!0,T=2&o?new r:void 0;for(l.set(e,t),l.set(t,e);++u e.seen.indexOf(p.value)?(i=E(r)?l(e,p.value,null):l(e,p.value,r-1),-1e.length)throw new RangeError("Index out of range")}function v(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function B(e,t,r,n,a){return t=+t,r>>>=0,a||v(e,t,r,4,34028234663852886e22,-34028234663852886e22),Q.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,a){return t=+t,r>>>=0,a||v(e,t,r,8,17976931348623157e292,-17976931348623157e292),Q.write(e,t,r,n,52,8),r+8}function F(e){if(e=e.split("=")[0],e=e.trim().replace(J,""),2>e.length)return"";for(;0!=e.length%4;)e+="=";return e}function q(e){return 16>e?"0"+e.toString(16):e.toString(16)}function G(e,t){t=t||1/0;for(var r=e.length,n=null,a=[],o=0,s;os){-1<(t-=3)&&a.push(239,191,189),n=s;continue}s=(n-55296<<10|s-56320)+65536}else n&&-1<(t-=3)&&a.push(239,191,189);if(n=null,128>s){if(0>(t-=1))break;a.push(s)}else if(2048>s){if(0>(t-=2))break;a.push(192|s>>6,128|63&s)}else if(65536>s){if(0>(t-=3))break;a.push(224|s>>12,128|63&s>>6,128|63&s)}else if(1114112>s){if(0>(t-=4))break;a.push(240|s>>18,128|63&s>>12,128|63&s>>6,128|63&s)}else throw new Error("Invalid code point")}return a}function j(e){for(var t=[],r=0;r>1,u=-7,T=n?l-1:0,E=n?-1:1,d=t[r+T],g,f;for(T+=E,g=d&(1<<-u)-1,d>>=-u,u+=p;0>=-u,u+=o;0>1,A=23===p?a(2,-24)-a(2,-77):0,b=l?0:_-1,y=l?1:-1,d=0>r||0===r&&0>1/r?1:0,s,N,S;for(r=E(r),isNaN(r)||r===1/0?(N=isNaN(r)?1:0,s=f):(s=n(T(r)/u),1>r*(S=a(2,-s))&&(s--,S*=2),r+=1<=s+h?A/S:A*a(2,1-h),2<=r*S&&(s++,S/=2),s+h>=f?(N=0,s=f):1<=s+h?(N=(r*S-1)*a(2,p),s+=h):(N=r*a(2,h-1)*a(2,p),s=0));8<=p;t[o+b]=255&N,b+=y,N/=256,p-=8);for(s=s<e.length)throw new RangeError("Index out of range")}function v(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function B(e,t,r,n,a){return t=+t,r>>>=0,a||v(e,t,r,4,34028234663852886e22,-34028234663852886e22),Q.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,a){return t=+t,r>>>=0,a||v(e,t,r,8,17976931348623157e292,-17976931348623157e292),Q.write(e,t,r,n,52,8),r+8}function F(e){if(e=e.split("=")[0],e=e.trim().replace(J,""),2>e.length)return"";for(;0!=e.length%4;)e+="=";return e}function q(e){return 16>e?"0"+e.toString(16):e.toString(16)}function G(e,t){t=t||1/0;for(var r=e.length,n=null,a=[],o=0,s;os){-1<(t-=3)&&a.push(239,191,189),n=s;continue}s=(n-55296<<10|s-56320)+65536}else n&&-1<(t-=3)&&a.push(239,191,189);if(n=null,128>s){if(0>(t-=1))break;a.push(s)}else if(2048>s){if(0>(t-=2))break;a.push(192|s>>6,128|63&s)}else if(65536>s){if(0>(t-=3))break;a.push(224|s>>12,128|63&s>>6,128|63&s)}else if(1114112>s){if(0>(t-=4))break;a.push(240|s>>18,128|63&s>>12,128|63&s>>6,128|63&s)}else throw new Error("Invalid code point")}return a}function j(e){for(var t=[],r=0;r>1,u=-7,T=n?l-1:0,E=n?-1:1,d=t[r+T],g,f;for(T+=E,g=d&(1<<-u)-1,d>>=-u,u+=p;0>=-u,u+=o;0>1,A=23===p?a(2,-24)-a(2,-77):0,b=l?0:_-1,y=l?1:-1,d=0>r||0===r&&0>1/r?1:0,s,N,S;for(r=E(r),isNaN(r)||r===1/0?(N=isNaN(r)?1:0,s=f):(s=n(T(r)/u),1>r*(S=a(2,-s))&&(s--,S*=2),r+=1<=s+h?A/S:A*a(2,1-h),2<=r*S&&(s++,S/=2),s+h>=f?(N=0,s=f):1<=s+h?(N=(r*S-1)*a(2,p),s+=h):(N=r*a(2,h-1)*a(2,p),s=0));8<=p;t[o+b]=255&N,b+=y,N/=256,p-=8);for(s=s<