Imgur to TalkImg - automatically fix your broken images
Imgur images don't work anymore, so you probably have lots of posts with broken images that look like this:
For context:
Imgur images suddenly became invalid?
So I created a script that:1. Goes through all your posts looking for imgur.com direct links (.png|.jpg|.jpeg);
2. Reuploads the image to talkimg.com (or imgbb);
3. Edits the post with the new link.
How to use it:1. Choose the image provider you want to use (change
provider to
imgbb or
talkimg - IMPORTANT: all lower case).
2. If you choose imgbb, you need an account and your own API key. Generate your API key
here and put it on providers -> imgbb -> apiKey (
example).
3. Go to bitcointalk.org (any page).
4. Open the browser developer tools on the Console tab (Ctrl+Shift+I or F12).
5. Paste the script and press Enter.
6. Leave the page open while the script runs and, if you can, do not use the forum (not even in other tabs) to avoid rate limiting errors.
If a error shows up, please report it here and/or run the script again (the process will start over, but already updated posts will be ignored since they won't have any more imgur.com links).
Script:- If you're using TalkImg, you are free to swap the API key to your own if you have an account there. Otherwise, there is already one provided by @joker_josue for this script.
- You can change the startPage variable if you want to start the script from a specific page (i.e the script errors at page 300 and you want to restart back from there).
GET THE SCRIPT CODE HERE: https://gist.github.com/ninjastic/36c14fb2eb1c4b750f40f332d408688f
"Single Topic" versionGet the code here:
https://gist.github.com/ninjastic/59bde80306c32153a5775b9a570b16b7Run it on any topic and all images posted by you will be updated.
IMPORTANT: only images that are shown on the screen! This means that if you are on page 1, the script won't update the images on page 2. You can use the ;all page on the forum to make all posts show up all at once (probably won't work properly if the topic is huge?).
Other notes:- This will upload and edit all imgur.com links found on your post history (even those inside quotes you made of other people).
- Posts on locked topics can't be edited, so the recently uploaded images for them will be deleted (to save space on the talkimg server).
- TalkImg max size limit is 2 MB, so some images may fail.
If you have broken bbcode resulted from an old version of the script, run this fix:
https://gist.github.com/ninjastic/d560848568339e5a2d7a25ddffb578d5