Bitcoin Forum
April 12, 2026, 09:03:28 AM *
News: Latest Bitcoin Core release: 30.2 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 [7]  All
  Print  
Author Topic: [Script] Imgur to TalkImg - automatically fix your broken images  (Read 2426 times)
joker_josue
Legendary
*
Offline Offline

Activity: 2352
Merit: 6792


**In BTC since 2013**


View Profile WWW
November 12, 2023, 04:32:41 PM
Merited by TryNinja (1)
 #121

Let's wait for TryNinja just in case. I guess the API key needs to be updated as well. If you use imgbb, you need to edit the API key in the code and enter your own. The API code is already set by default for your site, TalkImg, but it can also be edited. vgy.me surely has unique API codes as well. 

The API code is just for the script to upload to TalkImg.
The script does not use other API codes, it just takes the image link and sends it to TalkImg via API.


Note this explanation:
Imagine that I have images on Imgbb and I want to transfer them to TalkImg, is it possible?
Forgot to reply this one, sorry.

Yes, you can. I've added a imageLinkRegex variable at the top. It currently only matches imgur links ending with png, jpg, jpeg (edit: and gif).

If you want to match ONLY imgbb images, you can use:

Code:
/https:\/\/i\.ibb\.co\/.*?\.(png|jpg|jpeg|gif)/gi

If you want to match BOTH imgbb and imgur images:

Code:
/https:\/\/i\.ibb\.co\/.*?\.(png|jpg|jpeg|gif)|https:\/\/i\.imgur\.com\/.*?\.(png|jpg|jpeg|gif)/gi

 
 b1exch.to 
  ETH      DAI   
  BTC      LTC   
  USDT     XMR    
.███████████▄▀▄▀
█████████▄█▄▀
███████████
███████▄█▀
█▀█
▄▄▀░░██▄▄
▄▀██▄▀█████▄
██▄▀░▄██████
███████░█████
█░████░█████████
█░█░█░████░█████
█░█░█░██░█████
▀▀▀▄█▄████▀▀▀
TryNinja (OP)
Legendary
*
Offline Offline

Activity: 3528
Merit: 10078


@ List of no-KYC websites: https://bitlist.co


View Profile WWW
November 12, 2023, 04:34:38 PM
Merited by LoyceV (6), Pmalek (2), vapourminer (1)
 #122

I was wondering if there is a quick way to add new image hosts to the code? A few years ago, I used vgy.me for images in some of my threads. Perhaps the script could be used to automatically replace those links as well.  
Yes, there is.

joker_josue is correct. The following line is used to grab the images which are then uploaded to talkimg:

Code:
const imageLinkRegex = /https:\/\/i\.imgur\.com\/.*?\.(png|jpg|jpeg|gif)/gi

For vgy.me, you would probably use:

Code:
const imageLinkRegex = /https:\/\/vgy\.me\/.*?\.(png|jpg|jpeg|gif)/gi

Or for both imgur and vgy.me:

Code:
const imageLinkRegex = /https:\/\/vgy\.me\/.*?\.(png|jpg|jpeg|gif)|https:\/\/i\.imgur\.com\/.*?\.(png|jpg|jpeg|gif)/gi

 
 b1exch.to 
  ETH      DAI   
  BTC      LTC   
  USDT     XMR    
.███████████▄▀▄▀
█████████▄█▄▀
███████████
███████▄█▀
█▀█
▄▄▀░░██▄▄
▄▀██▄▀█████▄
██▄▀░▄██████
███████░█████
█░████░█████████
█░█░█░████░█████
█░█░█░██░█████
▀▀▀▄█▄████▀▀▀
Pmalek
Legendary
*
Offline Offline

Activity: 3458
Merit: 9123



View Profile
November 12, 2023, 06:08:13 PM
 #123

OK, it worked to some degree. The images that are still available and uploaded on vgy.me are now available with a TalkImg link. But it seems that for some reason vgy.me deleted most of the images I uploaded years ago. Those are unfortunately lost now. But that's not something that you can do anything about.

Excellent service, thanks a lot!

▄▄███████████████████▄▄
▄███████████████████████▄
████████████████████████
█████████████████████████
████████████████████████
████████████▀██████▀████
████████████████████████
█████████▄▄▄▄███████████
██████████▄▄▄████████████
████████████████████████
████████████████▀▀███████
▀███████████████████████▀
▀▀███████████████████▀▀
 
 EARNBET 
██
██
██
██
██
██
██
██
██
██
██
██
██
███████▄▄███████████
████▄██████████████████
██▀▀███████████████▀▀███
▄████████████████████████
▄▄████████▀▀▀▀▀████████▄▄██
███████████████████████████
█████████▌██▀████████████
███████████████████████████
▀▀███████▄▄▄▄▄█████████▀▀██
▀█████████████████████▀██
██▄▄███████████████▄▄███
████▀██████████████████
███████▀▀███████████
██
██
██
██
██
██
██
██
██
██
██
██
██


▄▄▄
▄▄▄███████▐███▌███████▄▄▄
█████████████████████████
▀████▄▄▄███████▄▄▄████▀
█████████████████████
▐███████████████████▌
███████████████████
███████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

 King of The Castle 
 $200,000 in prizes
██
██
██
██
██
██
██
██
██
██
██
██
██

 62.5% 

 
RAKEBACK
BONUS
ChiBitCTy
Legendary
*
Offline Offline

Activity: 2786
Merit: 3839



View Profile
May 05, 2024, 11:04:23 AM
Merited by PowerGlove (1)
 #124

I know some will be quite shocked, but I finally tried to run this, and uhh , coming up short...story of my life.

I read at least 6-7 articles on how to properly run a script, but not one explained how on a 1990's AOL Script Kiddie level of savy..thats more my speed.  Read through this thread best as I could (it's late, bout to east a snack and pass the f out).

I would post the exact errors but I dunno if by providing exposing anything I shouldn't.. but top error "Uncaught type error: Fail to execute"  then a second warning telling me I'm an idiot and not to post code I don't understand...They pegged me dead on there.

Any guidance would be much appreciated!  I have quite a few topics I worked hard on that need to img fixed and would sldo benefit those down the road to stay looking nice (here's what I tried to work on- https://bitcointalk.org/index.php?topic=5174217.0 ).  Sorry for being a dumbass ya'll.  cheers-ty


Had more to write,.just fell asleep doing it..all for now..thanks my friends for any guidance! 
TryNinja (OP)
Legendary
*
Offline Offline

Activity: 3528
Merit: 10078


@ List of no-KYC websites: https://bitlist.co


View Profile WWW
May 08, 2024, 12:00:59 AM
Merited by fillippone (4), ChiBitCTy (1)
 #125

Any guidance would be much appreciated!  I have quite a few topics I worked hard on that need to img fixed and would sldo benefit those down the road to stay looking nice (here's what I tried to work on- https://bitcointalk.org/index.php?topic=5174217.0 ).  Sorry for being a dumbass ya'll.  cheers-ty
Have you tried the "Single Topic" version?

"Single Topic" version

Get the code here: https://gist.github.com/ninjastic/59bde80306c32153a5775b9a570b16b7

Run 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?).

Just go to the topic you want to update (read the disclaimer above), copy the entire thing, open your console's developer tools console (on Chrome/Edge: Ctrl + Shift + I), paste it, run it.

Let me know of any errors you get.

 
 b1exch.to 
  ETH      DAI   
  BTC      LTC   
  USDT     XMR    
.███████████▄▀▄▀
█████████▄█▄▀
███████████
███████▄█▀
█▀█
▄▄▀░░██▄▄
▄▀██▄▀█████▄
██▄▀░▄██████
███████░█████
█░████░█████████
█░█░█░████░█████
█░█░█░██░█████
▀▀▀▄█▄████▀▀▀
ChiBitCTy
Legendary
*
Offline Offline

Activity: 2786
Merit: 3839



View Profile
May 17, 2024, 10:22:08 PM
 #126

Any guidance would be much appreciated!  I have quite a few topics I worked hard on that need to img fixed and would sldo benefit those down the road to stay looking nice (here's what I tried to work on- https://bitcointalk.org/index.php?topic=5174217.0 ).  Sorry for being a dumbass ya'll.  cheers-ty
Have you tried the "Single Topic" version?

"Single Topic" version

Get the code here: https://gist.github.com/ninjastic/59bde80306c32153a5775b9a570b16b7

Run 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?).

Just go to the topic you want to update (read the disclaimer above), copy the entire thing, open your console's developer tools console (on Chrome/Edge: Ctrl + Shift + I), paste it, run it.

Let me know of any errors you get.

Hell...please bare with me and if you want to ignore me, wouldn't blame ya!  I read all rules, and followed directions from your last post.  I realized I just had to comply with the chrome rules of "make sure you know what script you're running".  I then highlighted the entire box of code from your github link, and c/p/enter into console ..it ran and said it was fixing all the images , and each one now says uploaded with a talkimg link. At the end of everything in console remains lines 227-30..stating "Finished".  I now realize maybe I wasn't supposed to copy everything from that script box?  I stupidly missed the copy script button to the right of "embed". So, not sure if that was a fck up or not...assuming not..but assuming makes an ...well you know.

If I ran it properly, and I did so about 30mns ago now..none of the broken links were fixed.  I didn't get any errors though in the console box.  I also realize I may have fd up by simply opening btalk in another tab to type this up but I THINK the script had finished by that time. I think.  Perhaps the images are too large too..I dunno. I would doubt they all would be, however ( https://bitcointalk.org/index.php?topic=5174217.0 )

Apologies for being such a moron. I will def be donating a few sats regardless to that addy. I really appreciate all that you do here! .. as well as your fellow Mr Robots (like my buds LV and PG and of course the mods!)  


It worked, I'm good to go. Thanks !!
Pmalek
Legendary
*
Offline Offline

Activity: 3458
Merit: 9123



View Profile
June 28, 2024, 11:28:14 AM
Merited by TryNinja (3), vapourminer (1), PowerGlove (1)
 #127

TryNinja, I would like to make you aware of a bug in your code which affects the script, making image replacement unsuccessful. As @PowerGlove wrote in this post, his Post History fix makes your script not capable of doing what it's supposed to do. But if you change one line of code as described in the post, it will work again.

▄▄███████████████████▄▄
▄███████████████████████▄
████████████████████████
█████████████████████████
████████████████████████
████████████▀██████▀████
████████████████████████
█████████▄▄▄▄███████████
██████████▄▄▄████████████
████████████████████████
████████████████▀▀███████
▀███████████████████████▀
▀▀███████████████████▀▀
 
 EARNBET 
██
██
██
██
██
██
██
██
██
██
██
██
██
███████▄▄███████████
████▄██████████████████
██▀▀███████████████▀▀███
▄████████████████████████
▄▄████████▀▀▀▀▀████████▄▄██
███████████████████████████
█████████▌██▀████████████
███████████████████████████
▀▀███████▄▄▄▄▄█████████▀▀██
▀█████████████████████▀██
██▄▄███████████████▄▄███
████▀██████████████████
███████▀▀███████████
██
██
██
██
██
██
██
██
██
██
██
██
██


▄▄▄
▄▄▄███████▐███▌███████▄▄▄
█████████████████████████
▀████▄▄▄███████▄▄▄████▀
█████████████████████
▐███████████████████▌
███████████████████
███████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

 King of The Castle 
 $200,000 in prizes
██
██
██
██
██
██
██
██
██
██
██
██
██

 62.5% 

 
RAKEBACK
BONUS
dragonvslinux
Legendary
*
Offline Offline

Activity: 1792
Merit: 2238



View Profile
April 10, 2026, 04:53:47 PM
 #128

Bumpidy bump time I'm afraid. Mainly a question for TryNinja, though maybe others will be able to assist. Firstly, how easy would it be to modify this script to use on a different forum? Secondly, I can't remember how it worked when I used it before, but is it possible to implement on other users posts, assuming the account has the permissions to implement such changes? Basically having spoke to joker_josie I'm figuring out migrating images elsewhere, but it wouldn't just be for my posts, it would instead be a few others as well. Also the need to selectively change other users posts, rather than all of them, in a not-so-invasive type way... maybe you see what I'm trying to accomplish here.

Probably all that is beyond the capabilities of the script of anyone's desire to make modifications, but thought I'd ask anyway.
fillippone
Legendary
*
Online Online

Activity: 2856
Merit: 20288


Duelbits.com - Rewarding, beyond limits.


View Profile WWW
April 10, 2026, 07:51:04 PM
 #129

Bumpidy bump time I'm afraid. Mainly a question for TryNinja, though maybe others will be able to assist. Firstly, how easy would it be to modify this script to use on a different forum? Secondly, I can't remember how it worked when I used it before, but is it possible to implement on other users posts, assuming the account has the permissions to implement such changes? Basically having spoke to joker_josie I'm figuring out migrating images elsewhere, but it wouldn't just be for my posts, it would instead be a few others as well. Also the need to selectively change other users posts, rather than all of them, in a not-so-invasive type way... maybe you see what I'm trying to accomplish here.

Probably all that is beyond the capabilities of the script of anyone's desire to make modifications, but thought I'd ask anyway.

I guess the modification of a post, also known as "editing" require user password, i.e. consent.
So I think it would be extremely difficult to run this script without being logged in in each author's profile.
Maybe only a moderator could do that.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
dragonvslinux
Legendary
*
Offline Offline

Activity: 1792
Merit: 2238



View Profile
April 10, 2026, 07:55:18 PM
 #130

Maybe only a moderator could do that.

Yeh, that's I mean. Using global mod privileges to achieve such aims, it'd save doing it manually. At least, the edit link is the same regardless.
fillippone
Legendary
*
Online Online

Activity: 2856
Merit: 20288


Duelbits.com - Rewarding, beyond limits.


View Profile WWW
April 10, 2026, 08:03:28 PM
 #131

Maybe only a moderator could do that.

Yeh, that's I mean. Using global mod privileges to achieve such aims, it'd save doing it manually. At least, the edit link is the same regardless.

Aww now I understand. Yes. I think the best idea is asking directly to TryNinja to cook something specifically designed for you!
or... you can try to vibecode it! (not implying that Claude>Tryninja).

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
dragonvslinux
Legendary
*
Offline Offline

Activity: 1792
Merit: 2238



View Profile
April 10, 2026, 08:13:17 PM
Merited by fillippone (3)
 #132

or... you can try to vibecode it! (not implying that Claude>Tryninja).

Thanks but not going to do any vibecoding as I'm no coder, I've gotta edit some admin topics, so that would be somewhat reckless.

Probably using a script with mod privileges is ill advised but I'm thinking YOLO. I've been stripped and restored before so probably be ok.

Disclaimer: this is not mod advise.
Pages: « 1 2 3 4 5 6 [7]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!