Page 1 of 3
[Release] ComicVine Userscript
Posted: Sun May 25, 2014 6:53 pm
by erolosty
I've written a userscript which adds a mylar button to Comic Vine pages
You can paste the code into the Chrome extension
TamperMonkey
It assumes your Mylar url is:
http://localhost:8090 - if not please replace in the source.
Would be awesome if EvilHero added this to Mylar the same way CouchPotato lets you install userscript.
Regards,
Losty
Code: Select all
// ==UserScript==
// @name Comic Vine Mylar
// @namespace http://www.comicvine.com/
// @author Losty
// @include http://www.comicvine.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/addComic?comicid="+document.URL.split("/")[4].split("-")[1]+"'><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)
}
Re: [Release] ComicVine Userscript
Posted: Mon May 26, 2014 6:20 pm
by evilhero
heh, I was just thinking a few days ago that this would be something cool to have so that you can add it directly in
So sweet, I'll definitely figure out away to add this into the repo somehow kinda like the way CP does it..I just need to figure out how to do it .
Thanks for the code and the work!
Re: [Release] ComicVine Userscript
Posted: Fri Jan 02, 2015 3:27 am
by Offspring
I just tried using this script, but it wasn't working. Did something change on the Chrome/Tampermonkey side that broke it?
Re: [Release] ComicVine Userscript
Posted: Fri Jan 02, 2015 9:17 pm
by evilhero
I believe something changed on the ComicVine site itself so now the Userscript can't detect the page properly, and thereby place the Mylar logo on the screen. I briefly looked at it yesterday, but Userscripts aren't something I've used or tinkered with before.
If someone else can figure it out, it would save me the time in trying to figure things out (since I didn't create the script).
Re: [Release] ComicVine Userscript
Posted: Sun Jan 04, 2015 11:07 am
by Yager
I tried the script today and it seemed not to work. After i changed the execution order so this script gets executed first it works fine on my end.
Also would it be possible when you click the button you get a message that it is being added or something and not go to your mylar installation? That way you can add more comics faster.
Re: [Release] ComicVine Userscript
Posted: Mon Jan 05, 2015 12:57 am
by evilhero
I didn't even notice that I was using some other script - reloaded this one and it's working just fine. Although, at one point I did have to add one line to the UserScript delaration section :
I kept on getting a message saying that it had an invalid grant header (had a Warning icon in the tampermonkey dashboard). Adding that line let it go through and things started working again.
Also would it be possible when you click the button you get a message that it is being added or something and not go to your mylar installation? That way you can add more comics faster.
If anyone knows of a way to have the submit go through, but not update the current page (meaning don't browse away from it) - please let me know. It's possible now to replace the 'addComic?' function with the 'addbyid?' function, and have Mylar return to the previous command in the url call which would mean it wouldn't browse away from the page. I can't seem to figure the call out by doing the ajax method, so hopefully there's someone out there with the knowledge and foresight to do this (where's erolosty eh!)
Re: [Release] ComicVine Userscript
Posted: Mon Jan 05, 2015 2:45 am
by Offspring
Problem was that I was running TamperMonkey, not TamperMonkey BETA. By installing the beta version, the script started working.
Re: [Release] ComicVine Userscript
Posted: Wed Apr 20, 2016 4:41 am
by cojoMan
is this still working for anyone ?...
Re: [Release] ComicVine Userscript
Posted: Wed Apr 20, 2016 2:10 pm
by evilhero
cojoMan wrote:is this still working for anyone ?...
You probably want to use this one instead of the original (updated to include the new CV url + changed the function that is called as it's cleaner)
Also, if you run Mylar on a separate machine, or plan on browsing CV to add from a different machine, make sure to change the 'localhost' to whatever IP mylar is running on.
Code: Select all
// ==UserScript==
// @name Comic Vine Mylar
// @namespace http://comicvine.gamespot.com/
// @author Losty
// @include http://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);
}
This is working with the non-beta version of Tampermonkey and in Chrome Canary.
Make sure you install the Tampermonkey extension, not the Tampermonkey app (Tampermonkey doesn't have an app - it's a bogus app)
All made possible by Losty
Re: [Release] ComicVine Userscript
Posted: Wed Apr 20, 2016 2:13 pm
by cojoMan
thanks evilhero , thanks Lotsy
it's alive !!