Author Topic: Autocard as Opera Extension and Userjs  (Read 16185 times)

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Autocard as Opera Extension and Userjs
« on: October 27, 2008, 08:42:30 AM »
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 and their boards, mtgsalvation, starcity, crystalkeep, and obviously this forum and domain (www.shenafu.com).

As userScript:
autocard_mtg.user.js
Last updated April 14, 2016, version 1.58

Spoiler:
Get it from this link:
As Opera extension:
Install Autocard_MTG
Last updated February 10, 2011, version 1.2

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:
http://shenafu.com/magic/autocard_mtg.php

Video demonstration of this script in action:

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

Test the script on the following card links by moving your mouse over them:
Lord of Atlantis
Apprentice MTGO
 Autocard tests
Lord of Atlantis
Mesa Pegasus
Demonfire
Fire/Ice
Fire
Ice
Dead Gone
Bound//Determined
Bound
Determined
Armed/Dangerous
Ludevic's Test Subject
Ludevic's Abomination
Aberrant Researcher
Perfected Form
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 {Gotcha!}
why
BFM
BFM left
BFM right

Alias card names
Finkel
Bob
Tiago


Apprentice MTGO
 Upcoming Set Previews
Anticipate
Savage Ventmaw
Ojutai's Command
Foe-Razer Regent
Sidisi, Undead Vizier
--Reprints
Ultimate Price
Evolving Wilds

Apprentice MTGO
 Custom Cards that I Created
Double Striking
Double Dealing
Aqua-kin Flowmage
Atroex, Temporal Watcher
« Last Edit: April 14, 2016, 11:04:23 PM by Den »
Humans can be gay.
Superman is superhuman.
Q.E.D. Superman can be supergay.

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #1 on: August 15, 2009, 02:17:27 AM »
version 1.21
added support for puremtgo.com
reverted global functions

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #2 on: November 09, 2009, 05:27:10 PM »
version 1.22
grave, acute, dumb quotes

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #3 on: January 04, 2010, 12:10:17 PM »
version 1.23
wizards boards migrated, autocard link modified

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #4 on: April 19, 2010, 12:08:21 AM »
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)

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #5 on: April 24, 2010, 10:52:25 PM »
version 1.25
added site MTG Vault

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #6 on: October 10, 2010, 03:45:10 AM »
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)

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #7 on: October 18, 2010, 05:07:07 PM »
version 1.27
reinclude wizards.com, but disable native popup

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #8 on: November 02, 2010, 09:05:26 AM »
version 1.28
include daccg.com
hide / show img using style.display rather than visibility or z-index
clean up event handling
« Last Edit: November 02, 2010, 12:14:44 PM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard Userjs
« Reply #9 on: November 03, 2010, 09:21:27 PM »
version 1.29
modified attachment match pattern (from /attach/ to /attachment\.php/)

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #10 on: January 25, 2011, 08:59:14 PM »
Converted into Opera extension. Need Opera 11.

Install Autocard_MTG
Last updated February 10, 2011, version 1.2
« Last Edit: April 13, 2011, 11:25:49 PM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #11 on: April 19, 2011, 11:29:33 PM »
1.30
fix back quotes and multiple underscore

1.31
replace magiccards.info/query URLs

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
1.32
« Reply #12 on: June 01, 2011, 12:02:43 AM »
1.32
added card image directories
http://shenafu.com/images/mtg-cardname.jpg
http://shenafu.com/imgd/card2img/mtg-cardname.jpg

second URL scours net for image

ADMIN

  • Administrator
  • Member
  • *****
  • Posts: 22
    • View Profile
1.33
« Reply #13 on: June 07, 2011, 09:20:33 AM »
1.33
copied over the code from extension because it performed much better.

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #14 on: June 16, 2011, 09:44:36 PM »
1.34
firefox compatible
added cardnames with quotes to AUTOCARD_SPLIT because some sites do not escape the quotes correctly (e.g. crystalkeep)

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #15 on: June 30, 2011, 12:33:33 AM »
1.35
fix for www.wizards.com (match their new code; remove their mouseover code)

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #16 on: July 14, 2011, 12:26:42 PM »
1.36
hide image on mouseover

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #17 on: October 14, 2011, 09:00:24 PM »
1.37
Double-face cards show both faces
Changed replacement URL to http://magiccards.info/query?q=

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #18 on: April 05, 2012, 12:38:43 AM »
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
http://shenafu.com/imgd/ymtc/cardoriginal by amuseum.png

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #19 on: June 14, 2012, 11:26:25 AM »
1.39
magiccards.info/query remove beginning %21 or !

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #20 on: July 01, 2012, 02:23:25 PM »
1.40
added Dark Ascension transform cards.
fix commonly misspelled words (e.g. judgement -> judgment)

test transform cards

test misspelled words
Apprentice MTGO
 Decklist
day of judgement --judgment

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).
« Last Edit: July 02, 2012, 11:38:20 AM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #21 on: September 14, 2012, 05:03:32 PM »
1.43
fixed 'A' tags with child nodes steal events. so loop until parent node is 'A' or null.

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

1.45
included mtgredzone.com
« Last Edit: December 17, 2012, 10:07:04 PM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #22 on: March 22, 2013, 03:06:13 PM »
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
« Last Edit: April 02, 2013, 09:01:13 PM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
« Last Edit: May 03, 2013, 06:00:05 PM by Den »

ADMIN

  • Administrator
  • Member
  • *****
  • Posts: 22
    • View Profile
Re: Autocard as Opera Extension and Userjs
« Reply #24 on: February 04, 2014, 11:51:45 PM »
1.49
added RegExp for new MTGSalvation (Curse) Forums
added CSS Style Sheet to suppress websites' own autocard popup

TODO: fix StarCity Games
« Last Edit: February 04, 2014, 11:55:51 PM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #25 on: March 13, 2014, 09:05:25 PM »
1.50
added site www.ultimatemtgo.com
save as UTF-8 encoding

1.51
enable AUTOCARD_IMG_RE for http://shenafu.com/imgd/card2img/mtg-cardoriginal.jpg, which finds images from various 3rd party sites besides wizards.com
« Last Edit: August 14, 2014, 05:14:21 PM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #26 on: September 01, 2014, 05:34:20 PM »
1.52
included http://mtgsalvation.gamepedia.com/* (MTG Wiki moved here)

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #27 on: March 10, 2015, 08:31:34 PM »
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)
« Last Edit: June 10, 2015, 11:51:48 AM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #28 on: August 13, 2015, 03:36:05 PM »
1.55
added Magic Origins double faced cards

Apprentice MTGO
 Decklist
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

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
« Last Edit: April 16, 2016, 06:24:26 AM by Den »

Den

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 922
  • Selina is my Superstar
    • View Profile
    • Amuseum
Re: Autocard as Opera Extension and Userjs
« Reply #29 on: April 05, 2016, 08:05:10 PM »
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
« Last Edit: April 14, 2016, 11:03:59 PM by Den »