Skip to content

Instantly share code, notes, and snippets.

@vyach-vasiliev
Last active August 26, 2022 14:46
Show Gist options
  • Save vyach-vasiliev/cb7826aa808868a80a87cd2d27a2d837 to your computer and use it in GitHub Desktop.
Save vyach-vasiliev/cb7826aa808868a80a87cd2d27a2d837 to your computer and use it in GitHub Desktop.
Get links favorite images from 500px.com

Recently, the 500px.com platform has restricted access to favorites photos in order to force the user to purchase of a premium status.

These steps allow you to upload your favorites library in JSON format.

// prepare page
document.querySelector('#root > [class^="StyledLayout__Box"]').style.overflow = "scroll"; // add scroll to sidebar
// now sroll to end page, please

// run next code to continue
let links = document.querySelectorAll('#root [class^="StyledLayout__Container"] [id^="photo-"] a[role="link"]'); // get all image links

// packing links in `JSON`
let links_objs = [];
for (link of links){
    let img = link.querySelector('img');
    links_objs.push({'page': link.href, 'url': img ? img.src : null});
}
//let links_json = JSON.stringify(links_objs, null, 4); // indent formatted
let links_json = JSON.stringify(links_objs); // in single line

console.log(links_json);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment