Notes
Notes - notes.io |
{
"name": "Yad2 New Listings Finder",
"action": {},
"manifest_version": 3,
"version": "0.1",
"description": "Marks new Yad2 listings",
"permissions": [
"activeTab",
"scripting"
],
"content_scripts": [
{
"matches": [
"*://*.yad2.co.il/*"
],
"js": ["main.js"]
}
]
}
main.js:
var DEBUG = 1;
function debuglog(str) {
if (DEBUG) {
console.log(str);
}
}
function myGetDate(daysBehind) {
var date = new Date();
date.setDate(date.getDate() + daysBehind);
var dd = String(date.getDate()).padStart(2, '0');
var mm = String(date.getMonth() + 1).padStart(2, '0');
var yyyy = date.getFullYear();
return yyyy + mm + dd;
}
function paintListingsOf(date, color) {
debuglog("Searching for listings of " + date);
var fls = document.getElementsByClassName("feeditem table");
debuglog("Found " + String(fls.length) + " listings in this page");
for (let fl of fls) {
let crap = String(fl.getElementsByClassName("pic")[0].innerHTML);
let dateMatches = (crap.search(date) != -1);
let kaki = String(fl.getElementsByClassName("price")[0].innerHTML);
let hasPriceTag = (kaki.search("לא צוין מחיר") == -1);
if (dateMatches && hasPriceTag) {
debuglog("Found a matching listing!");
fl.getElementsByClassName("color_container")[0].style.backgroundColor = color;
}
else {
debuglog("Skipping");
}
}
}
function clearAllPaintings() {
// This is a scam but it works
paintListingsOf(0, "white");
}
console.log("yadi2 started.");
clearAllPaintings();
var today = myGetDate(0);
paintListingsOf(today, "green");
var yesterday = myGetDate(-1);
paintListingsOf(yesterday, "yellow");
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team