Brainly Notifications

Add a cool deskstop notitications systems.

  1. // ==UserScript==
  2. // @name Brainly Notifications
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Add a cool deskstop notitications systems.
  6. // @author Anonymous
  7. // @match *://*/*
  8. // @grant GM.xmlHttpRequest
  9. // @grant GM_notification
  10.  
  11.  
  12.  
  13. // ==/UserScript==
  14. // IF YOU ARE NOT FROM BRAINLY.IN , just change the url to your Brainly Market
  15. // Please be sure you are log to your account else it mays not work.
  16. // Don't steal the script please , it took me time to write it.
  17. // !!!!!! IMPORTANT!!!!!! REPLACE LAST NUMBERS BY YOUR LAST NUMBERQ LINK CONVERSATION , VERY IMPORTANT ,
  18. // THIS MEANS THIS SCRIPT WILL WORK WITH ONLY ONE USER FROM YOUR INBOX , IF YOU WANT IT TO WORKS WITH MORE, CREAT A SECOND SCRIPT LIKE THIS BUT WITH A NEW URL
  19. // IT WILL SAY YOU " ARE YOU SURE YOU WANT TO ACCEPT THIS DOMAIN", CLICK ON Always Accept to make the scripts work. More tools coming soon !!! ENJOY :)
  20.  
  21. window.onload = inbox()
  22. function inbox() {
  23. GM.xmlHttpRequest({
  24. method: "GET",
  25. url: "https://brainly.in/api/28/api_messages/get_messages/YOUR LAST CONVERSATION NUMBERS LINK",
  26. headers: {
  27. "User-Agent": "Chrome/83.0.4103.116", // If not specified, navigator.userAgent will be used.
  28. "Accept": "text/xml" // If not specified, browser defaults will be used.
  29. },
  30. onload: function(response) {
  31. var responseXML = null;
  32. // Inject responseXML into existing Object (only appropriate for XML content).
  33. if (!response.responseXML) {
  34. responseXML = new DOMParser()
  35. .parseFromString(response.responseText, "text/xml");
  36. }
  37. var data = JSON.parse(response.responseText);
  38. var convid = data.data.messages.conversation_id;
  39. var lastmsg = data.data.messages.user_id;
  40. var content = data.data.messages[24].content;
  41. var sendernick = data.users_data[1].nick;
  42. var img = data.users_data[1].avatar[0]
  43. var originalimg = img
  44. var statua = new Boolean(data.data.messages[24].new);
  45. if (data){console.log("Injected User Datas : Success")}else{alert("Failed to load User Datas, please log to your account")};
  46. if (statua==false){console.log("Ignore this")}else{GM_notification({title: sendernick+' sent you a message', text: content, image: 'https://i.stack.imgur.com/n5eFk.png'})};
  47.  
  48. console.log([
  49. statua,
  50. sendernick,
  51. response.status,
  52. response.statusText,
  53. response.readyState,
  54. response.responseHeaders,
  55. response.responseText,
  56. response.finalUrl,
  57. responseXML
  58. ].join("\n"));
  59. }
  60. })}; //Credits Image : Brainly.com , @Brainly , All right reserved