Bitcoin Forum
June 03, 2024, 04:51:52 PM *
News: Latest Bitcoin Core release: 27.0 [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 2112 times)
joker_josue
Legendary
*
Offline Offline

Activity: 1680
Merit: 4660


**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

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
TryNinja (OP)
Legendary
*
Offline Offline

Activity: 2856
Merit: 7106


Crypto Swap Exchange


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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pmalek
Legendary
*
Offline Offline

Activity: 2786
Merit: 7177



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!

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ChiBitCTy
Legendary
*
Offline Offline

Activity: 2282
Merit: 3013



View Profile
May 05, 2024, 11:04:23 AM
 #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! 

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
TryNinja (OP)
Legendary
*
Offline Offline

Activity: 2856
Merit: 7106


Crypto Swap Exchange


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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ChiBitCTy
Legendary
*
Offline Offline

Activity: 2282
Merit: 3013



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 !!

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
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!