Skip to content

Instantly share code, notes, and snippets.

@oriadam
Last active April 16, 2020 22:19
Show Gist options
  • Save oriadam/3b77af6f9c5e941f9586b0ff0e698acd to your computer and use it in GitHub Desktop.
Save oriadam/3b77af6f9c5e941f9586b0ff0e698acd to your computer and use it in GitHub Desktop.
@oriadam
Copy link
Author

oriadam commented Apr 16, 2020

create html of all images:

    let text = document.body.textContent;
    let ar = text.split('\n');
    let cont = document.createElement('div');
    ar.forEach(x => {
        let img = document.createElement('img');
        let a = document.createElement('a');
        a.href = x;
        a.target='_blank';
        img.src=x.replace('m.jpg','t.jpg');
        a.appendChild(img);
        cont.appendChild(a);
    });
    document.querySelector('body').appendChild(cont);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment