Last active
March 31, 2024 13:25
-
-
Save itsazzad/e77b21358ec606144a745491e33ee3db to your computer and use it in GitHub Desktop.
freelancer.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MAX = 352; | |
document.querySelectorAll("fl-list-item").forEach(item=>{ | |
const bidsEntryData = item.querySelector(".BidEntryData"); | |
if(bidsEntryData){ | |
const bids=bidsEntryData.textContent.match(/\d+/)[0]; | |
if(+bids<MAX/100||+bids>MAX/10){ | |
item.querySelectorAll(".BitsListItemHeader.HasHoverState").forEach(bitsItem=>{bitsItem.style.backgroundColor = "blue";}); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RegExp1 extends RegExp { | |
[Symbol.split](str, limit) { | |
const result = RegExp.prototype[Symbol.split].call(this, str, limit); | |
return result.map(x => x.trim()); | |
} | |
} | |
const skillsByName = {}; | |
const skillsByCount = {}; | |
const sections = document.querySelectorAll("#browseCategories > div > section") | |
for (let section of sections) { | |
const lis = section.querySelectorAll("ul > li"); | |
for (let li of lis) { | |
const as = li.querySelectorAll("a"); | |
let skillName = ""; | |
let jobCount = 0; | |
for (let a of as) { | |
const splitted = a.textContent.split(new RegExp1(/\(|\)/)) | |
if(splitted[0]){ | |
skillName = splitted[0]; | |
} | |
jobCount+=parseInt(splitted[splitted.length - 2]); | |
} | |
skillsByName[skillName] = jobCount; | |
if(!skillsByCount[jobCount]){ | |
skillsByCount[jobCount] = []; | |
} | |
skillsByCount[jobCount].push(skillName); | |
} | |
} | |
console.log(skillsByCount) | |
console.log(skillsByName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const skills = <GET_FROM_CATEGORIES>; | |
const list = document.querySelectorAll("fl-stat-type-list > div > ul li"); | |
list.forEach(item => { | |
const span = item.querySelector("span"); | |
const skill = span.textContent.trim(); | |
const newtext = document.createTextNode(skills[skill] + ":\t"); | |
span.prepend(newtext) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment