Skip to content

Instantly share code, notes, and snippets.

View Mamdouh-Freelancer's full-sized avatar
🎯
Focusing

Mamdouh Mamdouh-Freelancer

🎯
Focusing
View GitHub Profile
/*
@Mamdouh Freelancer
SO account: http://stackoverflow.com/users/7040620/
Github: https://github.com/Mamdouh-Freelancer
*/
//usage: location.href.param("key");
String.prototype.param = function(str) {
e = this.indexOf("?" + str + "=") > -1 ? "?" + str + "=" : "&" + str + "=";
/*
@ Created By Mamdouh Freelancer
@ Feel free to contact me any time
# https://fb.me/Mamdouh.Freelancer
# https://stackoverflow.com/users/7040620/mamdouh-freelancer
*/
function RedoUndo(a) {
if (!a) console.error("Add textarea using new RedoUndo(textareaElement)");
var curr = 0;
this.redoButton = function(b) {
@Mamdouh-Freelancer
Mamdouh-Freelancer / Olx-Seller-for-Expired-Ad
Last active November 26, 2022 11:37
Useful tool to access seller profile of expired ad. a Javascript code can be injected to the expired ad page via browser's console tab.
/*
This tool is useful to reach the seller if the ad is expired. Tested & works with Olx Egypt "olx.com.eg"
*/
adid = document.URL.split("-ID")[1].split(".")[0];
contact_info = "https://www.olx.com.eg/api/listing/" + adid + "/contactInfo/";
ad_details = "https://www.olx.com.eg/api/listing/?external_id=" + adid;
callAPI(contact_info, function(d) {
j = JSON.parse(d);
//output seller name & registered mobile number if exists
console.log("name:", j.name, "\nmobile:", j.mobile);