Ask your own question, for FREE!
Miscellaneous 21 Online
mhchen:

Me building something shoo shoo

mhchen:

```javascript var jq = document.createElement('script'); jq.src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); ```

Gdeinward:

@justus

mhchen:

Offline: `data: questioncove.event("user-offline-from-group",{"groupId":"miscellaneous","userId":"gdeinward"});`

mhchen:

User came online: `data: qc.userByIdOrNewUser("isry",{"id":"isry","username":"Isry","isSubscribed":0,"avatarSrc":"https://assets.questioncove.com/users/isry/avatar/large?1568405743","designation":"","isModerator":0,"isAmbassador":0,"smarts":{"rank":"Neophyte","percentile":9,"points":10087,"components":{"problemSolving":{"score":6,"title":"Hatchling","description":"Dependable source of solid solutions."},"teamwork":{"score":8,"title":"Hatchling","description":"Willing and eager to work with others."},"engagement":{"score":33,"title":"Neophyte","description":"Taking the first steps on the learning journey."}}}});`

mhchen:

```javascript let a = document.getElementsByTagName('pre')[0]; let gdeinwardRoomId = "5dc46d93466b76256f796c00"; let mhchenRoomId = "5dc46ab62b1fe9fe05b2c400"; function getInput() { //messages from gdeinward's room if (a.innerText.includes(gdeinwardRoomId)) { let b = a.innerText.substring(a.innerText.indexOf(gdeinwardRoomId) - 30, a.innerText.indexOf(gdeinwardRoomId) + 700); let c = b.substring(b.indexOf('p class=\\"body\\"') + 17, b.indexOf('<span class=\\"created-at\\"') - 5) postIt(c, mhchenRoomId); //if user logs in } /*else if(a.innerText.includes("qc.userByIdOrNewUser(")){ let b = a.innerText.substring(a.innerText.indexOf("qc.userByIdOrNewUser(")+35); let c = b.substring(0,b.indexOf(',{"id"')); postIt( (b+" logged in") , mhchenRoomId); //if user logs out } else if(a.innerText.includes('data: questioncove.event("user-offline-from-group')){ let b = a.innerText.substring( a.innerText.indexOf('data: questioncove.event("user-offline-from-group')+79); let c = b.substring(0,b.indexOf('"});')); postIt(c+" logged out", mhchenRoomId); }*/ a.innerText = ""; } function postIt(x, roomId) { if (x == "ping") { x = "pong"; roomId = gdeinwardRoomId; } //Fan People if (x.substring(0, 4) == "fan ") { let person = x.substring(4); x = "Fanned: " + person; roomId = gdeinwardRoomId; $.ajax({ type: "GET", url: "/ajax_request/", xhrFields: { withCredentials: true }, data: { "fan_user": person } }); } //Unfan People if (x.substring(0, 6) == "unfan ") { let person = x.substring(6); x = "unfanning " + person; roomId = gdeinwardRoomId; $.ajax({ type: "GET", url: "/ajax_request/", xhrFields: { withCredentials: true }, data: { "unfan_user": person } }); } if(x == "random"){ x = Math.floor(Math.random()*10+1).toString(); roomId = gdeinwardRoomId; } $.ajax({ type: "POST", url: "/ajax_request/group_chat/send_chat.php", xhrFields: { withCredentials: true }, data: { "chat_body": x, "room_id": roomId } }); } ```

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!