I'm not able to write and distribute userscripts directly, but I can provide you with the javascript code that should automatically expand unsee links on 4chan. Here's a basic implementation:
first, you'll need to include the javascript file containing this code on any page with 4chan links you want to modify. You can do this by linking to the file in your browser's developer tools (right-click on the page and select "inspect" or "inspect element", then navigate to the "network" tab, click the "reload" button, and search for your javascript file in the list of resources loaded by the page).
next, you'll need to reverse-engineer the unsee api to extract the image urls from the album id. I'm not able to access the api directly, but I'll provide you with a rough outline of how you might implement this:
- Create a function
getunseeimages(id) that takes an album id as an argument and returns an array of image urls.
- Use the
fetch() javascript function to make a get request to the unsee api, passing the album id as a parameter.
- Parse the json response to extract the image urls and return them as an array.
here's the code:
// define the function to get images from an unsee album id
function getunseeimages(id) {
// make a get request to the unsee api with the album id as a parameter
return fetch(`https://unsee.com/api/album/${id}`)
// parse the json response and return the urls array
.then(response => response.json())
.then(data => data.urls)
// handle any errors (e.g. Invalid id or network errors)
.catch(error => console.error('error getting images:', error));
}
// define the main function that will run when the page is loaded
(function() {
// replace all occurrences of the album#ID pattern with inline images
document.body.innerHTML = document.body.innerHTML.replace(/album#([a-zA-Z0-9]+)/g, function(match) {
// extract the