Kawiesh

Specific bms

Sep 26th, 2021 (edited)
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Lingo
  2. let create= (x)=> document.createElement(x),
  3. select= (x,y=document)=> y.querySelector(x),
  4. selectAll= (x,y=document)=> y.querySelectorAll(x);
  5.  
  6. let a= selectAll("a"),
  7. b= window.open(),
  8. c= create("textarea");
  9. c.style.cssText= `width: 100vw;
  10. min-height: 100vh;
  11. padding:5px;
  12. border:2px double blue;`;
  13.  
  14. b.document.body.append(c);
  15.  
  16. let ok= [...a].map(i=>{
  17. if(i.href.includes("programmas/lingo/")&&
  18. i.textContent.includes("aflevering")){
  19. return i.textContent.replace("Seizoen 3, aflevering","")+"] "+ i.href;
  20. }
  21. });
  22.  
  23. c.value= ok.join("\n");
  24.  
  25.  
  26.  
  27. //New window-----
  28. let a= create("textarea");
  29. b= window.open();
  30. b.document.body.append(a);
  31. a.style.cssText= `
  32. min-height:100vh;
  33. min-width:100vw;
  34. border: 5px ridge darkgray;
  35. padding: 5px;
  36. background: black;
  37. color: white`;
  38.  
  39. let final= [];
  40. select("textarea").onkeyup= function(){
  41. a.value="";
  42. a.value= final.join("\n");
  43. };
  44.  
  45.  
  46. //------------------
  47. let create= (x)=> document.createElement(x),
  48. select= (x,y=document)=> y.querySelector(x),
  49. selectAll= (x,y=document)=> y.querySelectorAll(x);
  50.  
  51.  
  52.  
  53.  
  54. let a= create("textarea"),
  55. b= window.open();
  56. b.document.body.append(a);
  57. a.style.cssText= `
  58. min-height:100vh;
  59. min-width:100vw;
  60. border: 5px ridge darkgray;
  61. padding: 5px;
  62. background: black;
  63. color: white`;
  64.  
  65.  
  66.  
  67. let lyrics=
  68. `main yahaan tu wahaan, zindagi hai kahaan
  69. I’m here you’re there, where is life?
  70. Tu hi tu hai sanam, dekhtaa hoon jahaan
  71. wherever I look, I see you my love
  72. neend aati nahin yaad jaati nahin
  73. can't sleepm the memories just won't go away
  74. bin tere ab jiya jaaye na
  75. Without you, living is becoming impossible
  76. main yahaan tu wahaan, zindagi hai kahaan
  77. I’m here you’re there, where is life?
  78. waqt jaise thahar gaya hai yehin, har taraf ek ajab udaasi hai
  79. as if time has stopped at the moment, there’s a strange sadness everywhere
  80. beqaraari ka aisa aalam hai,jism tanhaa hai ruuh pyaasi hai
  81. it's the time of restlessness, my body is lonely and soul is thirsty
  82. teri suurat ab ek pal, kyun nazar se hat-ti nahin?
  83. Why can't I see anything other than your face, even for a single moment?
  84. raat din to kat jaate hain, umr tanhaa kat-ti nahin
  85. Day and night pass shomehow, but this lonely life doesn't
  86. chaah ke bhi na kuchh kah sakuun tujhse main
  87. even though I want to, I can’t tell you anything
  88. dard kaise karuun main bayaan?
  89. How should I voice my pain?
  90. main yahaan tu wahaan, zindagi hai kahaan
  91. I’m here you’re there, where is life?
  92. jab kahin bhi aahat hui, yun lagaa ki tu aa gaya
  93. whenever I heard a sound somewhere, I thought it was yu.
  94. khushbuu ke jhonke ki tarah, meri saansein mahaka gaya
  95. Like a gust of fragrance, it scented my breath
  96. ek voh daur tha ham sadaa paas the
  97. there was that time when we were always together
  98. ab to hain faasale darmiyaan
  99. Now there’s such a distance between us
  100. main yahaan tu wahaan, zindagi hai kahaan
  101. I’m here you’re there, where is life?
  102. biti baatein yaad aati hain, jab akela hota hoon main
  103. Memories of the past come up, when I’m all alone
  104. bolti khaamoshiyaan, sabse chhupke rota huun main
  105. The silence speaks, while I hide and cry
  106. ek arsaa huwaa muskuraaye hue
  107. it's been so long since I smiled last
  108. aansuuyon mein dhali daastaan
  109. our story is filled with tears
  110. main yahaan tu wahaan, zindagi hai kahaan
  111. I’m here you’re there, where is life?
  112. Tu hi tu hai sanam, dekhtaa hoon jahaan
  113. wherever I look, I see you my love
  114. neend aati nahin yaad jaati nahin
  115. can't sleepm the memories just won't go away
  116. bin tere ab jiya jaaye na
  117. Without you, living iss becoming impossible
  118. ok
  119. `;
  120.  
  121. let x= lyrics.toLowerCase().split("\n");
  122. let final= [];
  123.  
  124.  
  125. select("textarea").onkeyup= function(){
  126. x.forEach((i,xo)=>{
  127. if(xo % 2 === 0) final.push(`<span class="hi">${x[xo]}</span>`);
  128. else final.push(`<span class="en">${x[xo]}</span>`);
  129. });
  130. a.value="";
  131. a.value= final.join("\n");
  132. };
  133.  
  134.  
  135. //-------
  136.  
  137. let $=x=>document.createElement(x);
  138.  
  139. let a= $("div"),
  140. b= $("textarea"),
  141. c= $("span");
  142. d= $("span");
  143.  
  144. document.body.append(a);
  145. a.append(b,c,d);
  146.  
  147. d.innerHTML= "&times;";
  148. document.body.style.position= "relative";
  149.  
  150.  
  151. d.style.cssText= `position:absolute;
  152. z-index:2;top:250px; right:250px;font-size:40px; color:red;`;
  153.  
  154. d.onclick=()=>{
  155. d.classList.toggle("hidden");
  156. if(d.classList.contains("hidden")){
  157. [b,c].forEach(i=>{
  158. i.style.display= "none";
  159. i.style.pointerEvents= "none";
  160. });
  161. }
  162. else{
  163. [b,c].forEach(i=>{
  164. i.style.display= "block";
  165. i.style.pointerEvents= "auto";
  166. });
  167. }
  168. };
  169.  
  170.  
  171.  
  172. c.innerHTML= "RUN";
  173. c.ontouchstart=()=> {c.style.background= "yellow";};
  174. c.ontouchend=()=> {c.style.background= "white";};
  175. c.onclick=()=> {eval(b.value);};
  176. c.style.cssText= `position:absolute;
  177. z-index:2;top:2px; right:2px;`;
  178.  
  179.  
  180. a.style.cssText=`width:500px;
  181. height:500px;z-index:100; position:fixed;
  182. top:calc((100% - 500px)/2);
  183. left:calc((100% - 500px)/2);`;
  184.  
  185. b.autocorrect= "off";
  186. b.autocapitalize= "off";
  187. b.style.cssText= `width:100%;height:100%;
  188. outline:none; padding:5px;z-index:1;`;
  189.  
  190. //----
  191.  
  192. let $=x=>document.createElement(x);
  193.  
  194. let a= $("div"),
  195. b= $("textarea"),
  196. c= $("span");
  197. d= $("span");
  198. a.id="lawlz";
  199.  
  200. let A= document.querySelector("#lawlz");
  201. if(A){
  202. A.remove();
  203. document.body.append(a);
  204. }else{
  205. document.body.append(a);
  206. }
  207. a.append(b,c,d);
  208.  
  209. d.innerHTML= "❌";
  210.  
  211. b.value=`let create= (x)=> document.createElement(x),
  212. select= (x,y=document)=> y.querySelector(x),
  213. selectAll= (x,y=document)=> y.querySelectorAll(x);
  214.  
  215. `;
  216.  
  217. function pe(x,y){
  218. if(y=="0"){
  219. x.forEach(i=> i.style.pointerEvents= "none");
  220. }
  221. else{
  222. x.forEach(i=> i.style.pointerEvents= "auto");
  223. }
  224.  
  225. }
  226.  
  227. d.style.cssText= `position:absolute;
  228. color:red;background:yellow; left:0; width:20px; height:20px; top:-20px;`;
  229.  
  230. d.onclick=()=>{
  231. d.classList.toggle("hidden");
  232. if(d.classList.contains("hidden")){
  233. pe([a,b,c],0);
  234. pe([d],1);
  235. [b,c].forEach(i=>{
  236. i.style.display= "none";
  237. });
  238. }
  239. else{
  240. pe([a,b,c,d],1);
  241. [b,c].forEach(i=>{
  242. i.style.display= "block";
  243. });
  244. }
  245. };
  246.  
  247.  
  248.  
  249.  
  250.  
  251. c.innerHTML= "RUN";
  252. c.ontouchstart=()=> {c.style.background= "yellow";};
  253. c.ontouchend=()=> {c.style.background= "white";};
  254. c.onclick=()=> {eval(b.value);};
  255. c.style.cssText= `position:absolute;
  256. z-index:2;top:2px; right:2px;`;
  257.  
  258.  
  259. a.style.cssText=`width:250px;
  260. height:200px;z-index:100; top:20px; position:absolute;
  261. `;
  262.  
  263. b.autocorrect= "off";
  264. b.autocapitalize= "off";
  265. b.style.cssText= `width:100%;height:100%;
  266. outline:none; padding:5px;z-index:1; font: bold 10px Courier New; white-space: nowrap`;
  267.  
  268.  
  269. d.addEventListener('touchmove', function(e) {
  270. var touchLocation = e.targetTouches[0];
  271. a.style.left= touchLocation.pageX + "px";
  272. a.style.top= touchLocation.pageY + "px";
  273. })
  274.  
  275. //---
  276. let w= document.documentElement.clientWidth - 500;
  277. let h= document.documentElement.scrollHeight - 500;
  278.  
  279. d.addEventListener('touchmove', function(e) {
  280. var touchLocation = e.targetTouches[0];
  281. a.style.left= Math.min(touchLocation.pageX,w) + "px";
  282. a.style.top= Math.min(touchLocation.pageY,h) + "px";
  283. })
  284.  
  285.  
  286.  
  287.  
  288. //---STARNIEUWS
  289.  
  290. let create= (x)=> document.createElement(x),
  291. select= (x,y=document)=> y.querySelector(x),
  292. selectAll= (x,y=document)=> y.querySelectorAll(x);
  293.  
  294. let url= "https://m.starnieuws.com",
  295. proxy= "https://corsproxy.kawiesh.workers.dev/?";
  296.  
  297. fetch(proxy+url)
  298. .then(r=>r.text())
  299. .then(data=>{
  300. let doc= new DOMParser().parseFromString(data,"text/html");
  301. let link= select("a[href*='nieuwsitem']",doc);
  302.  
  303. fetch(proxy+link)
  304. .then(r=>r.text())
  305. .then(data=>{
  306. let doc= new DOMParser().parseFromString(data,"text/html");
  307.  
  308. let parent= select("div[style='padding: 5px']",select(".content",doc));
  309. let title= select(".titel",parent).innerHTML;
  310. let time= select("i",parent).outerHTML;
  311. let article= select("div[style='font-size: 25px']",parent);
  312. let image= select("div[style^='float: right ; margin: 5px ;']",article);
  313. let src= select("img",image);
  314. let desc= select("i",image);
  315.  
  316. let a= `${src.outerHTML}
  317. ${desc.outerHTML}
  318. `;
  319. image.remove();
  320. alert(title+time+a+ article.innerHTML);
  321. }).catch(x=>alert(x))
  322. }).catch(x=>alert(x))alert(title+time+a+ article.innerHTML);
  323.  
  324.  
  325.  
  326.  
  327. //COVID
  328. let create= (x)=> document.createElement(x),
  329. select= (x,y=document)=> y.querySelector(x),
  330. selectAll= (x,y=document)=> y.querySelectorAll(x);        
  331.  
  332. let url= "https://covid-19.sr",
  333. proxy= "https://corsproxy.kawiesh.workers.dev/?";
  334. let regex1= /Nieuwe gevallen vandaag/i,
  335. regex2= /Overleden/i,
  336. regex3= /Totaal Testen/i,
  337. regex4= /Totaal negatieve Resultaten/i;
  338.  
  339.  
  340. fetch(proxy+url)
  341. .then(r=>r.text())
  342. .then(data=>{
  343. let doc= new DOMParser().parseFromString(data,"text/html");
  344.  
  345. let a,b,c;
  346. selectAll("div",doc).forEach(i=>{
  347. if(regex1.test(i.innerHTML)) a=i;
  348. if(regex2.test(i.innerHTML)) b=i;
  349. if(regex3.test(i.innerHTML)) c=i;
  350. if(regex4.test(i.innerHTML)) d=i;
  351. });
  352.  
  353. let nieuw= a.previousElementSibling.dataset.counterValue;
  354. let overl= b.previousElementSibling.dataset.counterValue;
  355. let totaal= c.previousElementSibling.dataset.counterValue;
  356. let neg= d.previousElementSibling.dataset.counterValue;
  357. let pos= (totaal - neg);
  358.  
  359. let percentage= ((pos/totaal) * 100).toFixed(2);
  360.  
  361. let message= `Nieuwe gevallen : ${nieuw}
  362. Overleden: ${overl}
  363. Testen: ${percentage}% positief (${pos}/${totaal})
  364. `;
  365.  
  366. alert(message);
  367. })
  368. .catch(x=>alert(x));
  369.  
  370.  
  371.  
  372. //LIDWOORD-----
  373.  
  374.  
  375. let create= (x)=> document.createElement(x),
  376. select= (x,y=document)=> y.querySelector(x),
  377. selectAll= (x,y=document)=> y.querySelectorAll(x);
  378.  
  379. let url= "https://www.welklidwoord.nl/groot-of-grote/",
  380. proxy= "https://cors.krishan.workers.dev/?";
  381.  
  382.  
  383. let word= "jongen";
  384.  
  385. fetch(proxy+url+word)
  386. .then(r=>r.text())
  387. .then(d=>{
  388. let doc= new DOMParser().parseFromString(d,"text/html");
  389.  
  390. let win= window.open();
  391. let xo= create("textarea");
  392. xo.style.cssText= `width:100vw; height:100vh;`;
  393. win.document.body.append(xo);
  394.  
  395. let text= select("p",doc).innerText.trim()
  396. .replace(/[\t\r\n\f]+/g,"\n");
  397.  
  398. let z= text.split("\n");
  399.  
  400. let Final= [...z].map(i=> i.trim()).filter(i=>i);
  401.  
  402.  
  403. let lw= Final[0].match(/(?<=het lidwoord\s)[A-Z]+/);
  404. let wo= Final[0].match(/(?<=Bij\s)[A-Z]+/i);
  405.  
  406. let het= (lw.toString()=="HET");
  407.  
  408. let vw= (!het) ? "deze/die" : "dit/dat";
  409. let q= "Het, mijn, jouw, zijn, haar, uw, ons, jullie of hun";
  410. let Q= "het/mijn/jouw/zijn/haar/uw/ons/jullie/hun";
  411.  
  412.  
  413. let x1= Final[1].split(/ ?\* ?/)[0];
  414. let x2= Final[2].split(/ ?\* ?/)[0];
  415.  
  416. let x3,x4;
  417.  
  418. if(Final.length>3){
  419. x3= Final[3].split(/ ?\* ?/)[0];
  420. x4= Final[4].split(/ ?\* ?/)[0].replace(q,Q);
  421. }
  422.  
  423. let xovalue=`Lidwoord: ${lw.toString().toLowerCase()} ${wo}
  424. Aanw.vnw.: ${vw} ${wo}
  425. ${x1}
  426. ${x2}
  427. ${x3||""}
  428. ${x4||""}`;
  429.  
  430.  
  431. xo.value= xovalue;
  432. //xo.value= Final.join("🌈");
  433. })
  434. .catch(x=>alert(x))
Add Comment
Please, Sign In to add comment