Brainly Notifications

Add a cool deskstop notitications systems.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Brainly Notifications
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Add a cool deskstop notitications systems.
// @author       Anonymous
// @match        *://*/*
// @grant         GM.xmlHttpRequest
// @grant         GM_notification



// ==/UserScript==
// IF YOU ARE NOT FROM BRAINLY.IN , just change the url to your Brainly Market
// Please be sure you are log to your account else it mays not work.
// Don't steal the script please , it took me time to write it.
// !!!!!! IMPORTANT!!!!!! REPLACE LAST NUMBERS BY YOUR LAST NUMBERQ LINK CONVERSATION , VERY IMPORTANT ,
// 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
// 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 :)

window.onload = inbox()
function inbox() {
GM.xmlHttpRequest({
  method: "GET",
  url: "https://brainly.in/api/28/api_messages/get_messages/YOUR LAST CONVERSATION NUMBERS LINK",
  headers: {
    "User-Agent": "Chrome/83.0.4103.116",    // If not specified, navigator.userAgent will be used.
    "Accept": "text/xml"            // If not specified, browser defaults will be used.
  },
  onload: function(response) {
    var responseXML = null;
    // Inject responseXML into existing Object (only appropriate for XML content).
    if (!response.responseXML) {
      responseXML = new DOMParser()
        .parseFromString(response.responseText, "text/xml");
    }
     var data = JSON.parse(response.responseText);
     var convid = data.data.messages.conversation_id;
     var lastmsg = data.data.messages.user_id;
     var content = data.data.messages[24].content;
     var sendernick = data.users_data[1].nick;
     var img = data.users_data[1].avatar[0]
     var originalimg = img
     var statua = new Boolean(data.data.messages[24].new);
     if (data){console.log("Injected User Datas : Success")}else{alert("Failed to load User Datas, please log to your account")};
     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'})};

      console.log([
      statua,
      sendernick,
      response.status,
      response.statusText,
      response.readyState,
      response.responseHeaders,
      response.responseText,
      response.finalUrl,
      responseXML
    ].join("\n"));
  }
})}; //Credits Image :  Brainly.com ,  @Brainly , All right reserved