[Release] ComicVine Userscript

Information and Tutorials on features in Mylar and how to use it
User avatar
evilhero
Site Admin
Posts: 2271
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: [Release] ComicVine Userscript

Post by evilhero » Mon Apr 10, 2017 1:08 pm

Just a quick update on this - since CV changed to https enforced now, this script won't work...so here's the updated one:

Code: Select all

// ==UserScript==
// @name        Comic Vine Mylar
// @namespace   https://comicvine.gamespot.com/
// @author      Losty
// @include     https://comicvine.gamespot.com/*
// @version     1
// ==/UserScript==
if ($($(".wiki-page-type")[0]).text().indexOf("Volume") != -1){
   current = $($(".instapaper_title")[0]).html();
   $($(".instapaper_title")[0]).html("<a href='http://localhost:8090/addbyid?comicid="+document.URL.split("/")[4].split("-")[1]+"' target='_blank'><img style='width:50px' alt='Download with Mylar' title='Download with Mylar' src='https://raw.githubusercontent.com/evilhero/mylar/master/data/images/mylarlogo.png'/></a>"+current);
}

kongponleu88
Posts: 1
Joined: Sat May 20, 2017 2:20 am

Re: [Release] ComicVine Userscript

Post by kongponleu88 » Sat May 20, 2017 3:01 am

nice

User avatar
evilhero
Site Admin
Posts: 2271
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: [Release] ComicVine Userscript

Post by evilhero » Wed Aug 01, 2018 3:37 pm

Simple update to include the new CV url as it was pointing to an old one...
(remember to change the http://localhost:8090 from localhost to whatever it actually is, if it's different than localhost)

Code: Select all

// ==UserScript==
// @name           Comic Vine Mylar
// @namespace   https://comicvine.gamespot.com/
// @author          Losty
// @include         https://comicvine.gamespot.com/*
// @version         1
// @grant            none
// ==/UserScript==
if ($($(".wiki-page-type")[0]).text().indexOf("Volume") != -1){
   current = $($(".instapaper_title")[0]).html();
   $($(".instapaper_title")[0]).html("<a href='http://localhost:8090/addbyid?comicid="+document.URL.split("/")[4]+"&calledby=True' rel='nofollow' target='_blank'><img style='width:50px' alt='Add to your Watchlist' title='Add to your Watchlist' src='https://raw.githubusercontent.com/evilhero/mylar/master/data/images/mylarlogo.png'/></a>"+current);
}

User avatar
oldirtdog
Posts: 56
Joined: Fri Nov 04, 2016 7:52 pm

Re: [Release] ComicVine Userscript

Post by oldirtdog » Fri Aug 03, 2018 6:33 pm

Maybe I'm missing something or perhaps it's related to the fact that I'm doing it on Safari, but the Tampermonkey console shows a parsing error: invalid token on the last line of the script. I just did a copy and paste of the last update from EvilHero.

User avatar
evilhero
Site Admin
Posts: 2271
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: [Release] ComicVine Userscript

Post by evilhero » Fri Aug 03, 2018 6:52 pm

Doh - copy/pasta error on my part. Forgot the trailing elipse "}" - modified the above code to include it so if you try again with the updated code it should work properly ;)

User avatar
oldirtdog
Posts: 56
Joined: Fri Nov 04, 2016 7:52 pm

Re: [Release] ComicVine Userscript

Post by oldirtdog » Sat Aug 04, 2018 6:00 pm

Again, maybe I'm doing something wrong or maybe it's safari, but I'm just getting more errors in Tampermonkey... I'm using V.4.7.5826 if that matters... When I go to CV, I also don't see any mylar button on a comic page. Here's what I'm getting:

Line 9 warning shows $ is not defined, twice
Line 10 shows an error "Implicit global variable, assign as global property instead" and the warnings for current and $ not defined.
Line 11 shows the same $ warnings from line 9

User avatar
evilhero
Site Admin
Posts: 2271
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: [Release] ComicVine Userscript

Post by evilhero » Sat Aug 04, 2018 6:30 pm

I"m limited in my troubleshooting abit on this, as I can only test on Chrome/IE.

However, the errors you listed are fine - mine has the same thing in them (due to $ being the declaration of a variable I believe), and it still works. The Mylar logo will only appear beside the series title when you're viewing the series page, not an issue page. (ie. https://comicvine.gamespot.com/volume/4050-22775/). Make sure you have the script enabled within the Tampermonkey dashboard. I'm using version 4.6 (having problems updating to 4.7 for some reason, but I don't think it would break things)

I've read about some problems with Tampermonkey and using Safari due to apple pulling back some support of some aspects that are required for Tampermonkey to work - but I honestly haven't a clue in regards to what's working vs. what's not when it comes to Mac stuff.

User avatar
oldirtdog
Posts: 56
Joined: Fri Nov 04, 2016 7:52 pm

Re: [Release] ComicVine Userscript

Post by oldirtdog » Mon Aug 06, 2018 1:08 pm

ok, I see the button on the series... clicking it brings up a new, blank tab with my server name in the address... it seems like it works, and I can now see the series in mylar... I assume that's all it needs to do, so I think we're good to go... done in Safari, btw, so I guess it works there (for now) :)

Thank YOU!

Post Reply