News:

Introducing VSV = Versatile Separated Values. Simple, elegant format usable for lists, tables, object notation, subtitles, playlists.

Main Menu

Autocard as Opera Extension and Userjs

Started by Den, 2008-Oct-27 08:42

Previous topic - Next topic

Den

This is an Opera extension / userscript that I wrote that lets you view a card's image when you mouseover a link in Magic related sites, including wizards.com, mtgsalvation, starcity, and obviously this forum and domain (ieants.cc).

As userScript:
autocard_mtg.user.js
Last updated May 01, 2020, version 1.66

[spoiler]Get it from this link:
As Opera extension:
Install Autocard_MTG
Last updated February 10, 2011, version 1.2[/spoiler]

For Opera, save this script in userjs folder.
For Firefox, install Greasemonkey add-on. Click the link and install the script.

More information can be found at the following URL:
https://ieants.cc/magic/autocard_mtg.php

Video demonstration of this script in action:

[video]http://www.youtube.com/v/-yyZqtFcB2s&hl=en&fs=1[/video]

Test the script on the following card links by moving your mouse over them:
Lord of Atlantis
[deck=Autocard tests]
Lord of Atlantis
Mesa Pegasus
Demonfire
Fire/Ice
Fire
Ice
Dead Gone
Bound//Determined
Bound
Determined
Armed/Dangerous
Appeal//Authority
Appeal
Authority
Ludevic's Test Subject
Ludevic's Abomination
Aberrant Researcher
Perfected Form
Docent of Perfection
Final Iteration
Eternal Witness
Gaea's Skyfolk
Day of Judgement -- should be judgment, script autofixes certain misspellings
Kiki-Jiki, Mirror Breaker
Aerathi Berserker
Vedalken Æthermage
Looter il-Kor
Nath of the Gilt-Leaf
Lys Alana Scarblade
Circle of Protection: Artifacts
Rune_of_Protection:_Green
To Arms!
Temple Elder
Pang Tong, "Young Phoenix"
Riding Red Hare {Portals 3 Kingdoms}
Erase
Erase (Not the Urza's Legacy One)
Goblin S.W.A.T. Team
Land Aid `04
Look at Me, I'm R&D
Sauté
_____ {at least 5 long}
Question Elemental?
Richard Garfield, Ph.D.
Who/What/When/Where/Why
The Ultimate Nightmare of Wizards of the Coast(R) Customer Service
The Ultimate Nightmare of Wizards of the Coast® Customer Service
Super Secret Tech {[card=name dropping]Gotcha![/card]}
why
BFM
BFM left
BFM right
[/deck]

Alias card names
[card=Finkel]shadowmage infiltrator[/card]
[card=Bob]dark confidant[/card]
[card=Tiago]Snapcaster Mage[/card]


[deck=Upcoming Set Previews]
Anticipate
Savage Ventmaw
Ojutai's Command
Foe-Razer Regent
Sidisi, Undead Vizier

--Reprints
Ultimate Price
Evolving Wilds
[/deck]

[deck=Custom Cards that I Created]
Double Striking
Double Dealing
Aqua-kin Flowmage
Atroex, Temporal Watcher
[/deck]
Support me on Patreon

I saw. I conquered. I came.

Den

version 1.21
added support for puremtgo.com
reverted global functions
Support me on Patreon

I saw. I conquered. I came.

Den

version 1.22
grave, acute, dumb quotes
Support me on Patreon

I saw. I conquered. I came.

Den

version 1.23
wizards boards migrated, autocard link modified
Support me on Patreon

I saw. I conquered. I came.

Den

version 1.24
added image URL to a script on my site so that one can find arts for cards that would be otherwise unavailable by default naming (eg newly spoiled cards or cards with aliases such as legends and planeswalkers)
Support me on Patreon

I saw. I conquered. I came.

Den

version 1.25
added site MTG Vault
Support me on Patreon

I saw. I conquered. I came.

Den

version 1.26
exclude sites that have their own pop up script (wizards.com, tcgplayer.com)
fixed link match for tcgplayer (in case one wants to re-include that site)
Support me on Patreon

I saw. I conquered. I came.

Den

version 1.27
reinclude wizards.com, but disable native popup
Support me on Patreon

I saw. I conquered. I came.

Den

#8
version 1.28
include daccg.com
hide / show img using style.display rather than visibility or z-index
clean up event handling
Support me on Patreon

I saw. I conquered. I came.

Den

version 1.29
modified attachment match pattern (from /attach/ to /attachment\.php/)
Support me on Patreon

I saw. I conquered. I came.

Den

#10
Converted into Opera extension. Need Opera 11.

Install Autocard_MTG
Last updated February 10, 2011, version 1.2
Support me on Patreon

I saw. I conquered. I came.

Den

1.30
fix back quotes and multiple underscore

1.31
replace magiccards.info/query URLs
Support me on Patreon

I saw. I conquered. I came.

Den

Support me on Patreon

I saw. I conquered. I came.

ADMIN

1.33
copied over the code from extension because it performed much better.

Den

1.34
firefox compatible
added cardnames with quotes to AUTOCARD_SPLIT because some sites do not escape the quotes correctly (e.g. crystalkeep)
Support me on Patreon

I saw. I conquered. I came.

Den

1.35
fix for www.wizards.com (match their new code; remove their mouseover code)
Support me on Patreon

I saw. I conquered. I came.

Den

Support me on Patreon

I saw. I conquered. I came.

Den

1.37
Double-face cards show both faces
Changed replacement URL to http://magiccards.info/query?q=
Support me on Patreon

I saw. I conquered. I came.

Den

1.38
added regex to also match original card name
added regex for image URL to match cards made by amuseum in Shenafu's Card Creator
https://ieants.cc/imgd/ymtc/cardoriginal by amuseum.png
Support me on Patreon

I saw. I conquered. I came.

Den

1.39
magiccards.info/query remove beginning %21 or !
Support me on Patreon

I saw. I conquered. I came.

Den

#20
1.40
added Dark Ascension transform cards.
fix commonly misspelled words (e.g. judgement -> judgment)

test transform cards
[spoiler]
[deck]
werewolf ransacker
chalice of death
markov's servant
withengar unbound
hinterland scourge
ravager of the fells
silverpelt werewolf
unhallowed cathar
tovolar's magehunter
archdemon of greed
moonscarred werewolf
ghastly haunting
krallenhorde killer
[/deck][/spoiler]

test misspelled words
[deck]
day of judgement --judgment
[/deck]

1.41
fix transform no longer match cards that match part of the name (e.g. terror should not pop up terror of kruin pass).
Support me on Patreon

I saw. I conquered. I came.

Den

#21
1.43
fixed 'A' tags with child nodes steal events. so loop until parent node is 'A' or null.

1.44
now works with https://ieants.cc/imgd/card2img/mtg-cardoriginal.jpg , where it takes unchanged card name
https://ieants.cc/imgd/card2img/mtg-cardname.jpg script finds cards at magiccards.info and scours the page for the image source

1.45
included mtgredzone.com
Support me on Patreon

I saw. I conquered. I came.

Den

#22
1.46
magiccards.info flip cards and double-face cards have 'a' and 'b' in URL: e.g. http://magiccards.info/dka/en/71a.html & http://magiccards.info/dka/en/71a.html

1.47
added site mtgcolorpie.com
change \u2019 (dumb quote) to apostrophe
Support me on Patreon

I saw. I conquered. I came.

Den

#23
1.48
added Dragon's Maze split cards
[deck=test DGM splits]
Turn
Burn
Turn//Burn
Turn/Burn
Turn_Burn

alive_well
armed_dangerous
beck_call
breaking_entering
catch_release
down_dirty
far_away
flesh_blood
give_take
profit_loss
protect_serve
ready_willing
toil_trouble
turn_burn
wear_tear
[/deck]
Support me on Patreon

I saw. I conquered. I came.

ADMIN

#24
1.49
added RegExp for new MTGSalvation (Curse) Forums
added CSS Style Sheet to suppress websites' own autocard popup

TODO: fix StarCity Games

Den

#25
1.50
added site www.ultimatemtgo.com
save as UTF-8 encoding

1.51
enable AUTOCARD_IMG_RE for https://ieants.cc/imgd/card2img/mtg-cardoriginal.jpg, which finds images from various 3rd party sites besides wizards.com
Support me on Patreon

I saw. I conquered. I came.

Den

Support me on Patreon

I saw. I conquered. I came.

Den

#27
1.53
scrape Wizards.com spoiled cards for upcoming set
http://magic.wizards.com/en/articles/archive/card-image-gallery/$SETNAME
(need to modify imgd/card2img2.php for every new set)

1.54
fix infinite loop in Firefox (img.complete buggy in FF)
Support me on Patreon

I saw. I conquered. I came.

Den

#28
1.55
added Magic Origins double faced cards

[deck]
Kytheon, Hero of Akros
Jace, Vryn's Prodigy
Liliana, Heretical Healer
Chandra, Fire of Kaladesh
Nissa, Vastwood Seer

Gideon, Battle-Forged
Jace, Telepath Unbound
Liliana, Defiant Necromancer
Chandra, Roaring Flame
Nissa, Sage Animist
[/deck]

1.56
debug mode option
debug log as fixed P element
debug mode logs imgs[cardname] (all URLs under that cardname)
include file://localhost/
move gatherer.wizards.com to last
Support me on Patreon

I saw. I conquered. I came.

Den

#29
1.57
included site slightlymagic.net (software development forums and wiki, including Forge)

1.58
added Shadows over Innistrad DFCs
move gatherer.wizards.com to 2nd
Support me on Patreon

I saw. I conquered. I came.

Den

#30
1.59
alter to https as necessary
removed nonexistent domains

TODO:
fix sites: mtgsalvation.com, yawgatog.com, goblinartisans.blogspot.com, magic-league.com


1.60
fixed scraping from magiccards.info
added split cards from Amonkhet, Hour of Devastation
added transform cards from Eldritch Moon
[deck=Split Cards]
// Amonkhet
Commit
Memory
Cut
Ribbons
Destined
Lead
Dusk
Dawn
Failure
Comply
Heaven
Earth
Insult
Injury
Mouth
Feed
Never
Return
Onward
Victory
Prepare
Fight
Rags
Riches
Reduce
Rubble
Spring
Mind
Start
Finish

// Hour of Devastation
Appeal
Authority
Claim
Fame
Consign
Oblivion
Driven
Despair
Farm
Market
Grind
Dust
Leave
Chance
Reason
Believe
Refuse
Cooperate
Struggle
Survive
[/deck]

[deck=Transform cards]
// Front
Extricator of Sin
Lone Rider
Curious Homunculus
Docent of Perfection
Grizzled Angler
Voldaren Pariah
Conduit of Storms
Smoldering Werewolf
Vildin-Pack Outcast
Kessig Prowler
Shrill Howler
Tangleclaw Werewolf
Ulvenwald Captive
Ulrich of the Krallenhorde
Cryptolith Fragment
Bruna, the Fading Light
Gisela, the Broken Blade
Graf Rats
Midnight Scavengers
Hanweir Garrison
Hanweir Battlements

// Back
Extricator of Flesh
It That Rides as One
Voracious Reader
Final Iteration
Grisly Anglerfish
Abolisher of Bloodlines
Conduit of Emrakul
Erupting Dreadwolf
Dronepack Kindred
Sinuous Predator
Howling Chorus
Fibrous Entangler
Ulvenwald Abomination
Ulrich, Uncontested Alpha
Aurora of Emrakul
Brisela, Voice of Nightmares
Brisela, Voice of Nightmares
Chittering Host
Chittering Host
Hanweir, the Writhing Township
Hanweir, the Writhing Township
[/deck]
Support me on Patreon

I saw. I conquered. I came.

Den

#31
1.61
included site scryfall.com
scrape using scryfall API
added transform cards from Ixalan block

[deck=Transform cards]
// front
Legion's Landing
Search for Azcanta
Arguel's Blood Fast
Hadana's Climb
Journey to Eternity
Path of Mettle
Profane Procession
Storm the Vault
Vance's Blasting Cannons
Azor's Gateway
Golden Guardian
Growing Rites of Itlimoc
Conqueror's Galleon
Dowsing Dagger
Primal Amulet
Thaumatic Compass
Treasure Map

// back
Adanto, the First Fort
Azcanta, the Sunken Ruin
Temple of Aclazotz
Winged Temple of Orazca
Atzal, Cave of Eternity
Metzali, Tower of Triumph
Tomb of the Dusk Rose
Vault of Catlacan
Spitfire Bastion
Sanctum of the Sun
Gold-Forge Garrison
Itlimoc, Cradle of the Sun
Conqueror's Foothold
Lost Vale
Primal Wellspring
Spires of Orazca
Treasure Cove
[/deck]
Support me on Patreon

I saw. I conquered. I came.

Den

1.62 - 1.63

; improve regex to extract cardname from scryfall link
Support me on Patreon

I saw. I conquered. I came.

Den

Support me on Patreon

I saw. I conquered. I came.