flamebyrd: (Default)
[personal profile] flamebyrd posting in [community profile] ao3some
I edited the default Pinboard bookmarklet (the button you put in your browser bookmarks to let you quickly add links to Pinboard) so that it will grab the tags and summary from AO3 and include those in the Pinboard tags/description.

Would anybody who uses Pinboard for their bookmarks rather than AO3 be interested in that if I posted it?

I made a generator for the bookmarklet to allow people to choose which tags to include and so on. http://random.fangirling.net/fun/ao3/bookmarklet.html

(I tried to do the same for Delicious but it doesn't look like I can pass tags to it.)

Date: 2012-06-17 05:39 pm (UTC)
saekhwa: Asian woman with short black hair & arms outspread and text that reads: 'free' (still an awkward girl with cute shoes)
From: [personal profile] saekhwa
OMG YES PLEASE?

This would be so amazing and save on so much time. (I'm, um. A little too thorough with my tags, so to speak, and trying to capture that data has been a PITA in more ways than one.)

Date: 2012-06-17 05:44 pm (UTC)
snakeling: Statue of the Minoan Snake Goddess (Default)
From: [personal profile] snakeling
Yes please! Also, would you consider making one that only grabs the summary and not the tags, because I prefer to use mine :)

Date: 2012-06-17 06:19 pm (UTC)
lian: Klavier Gavin, golden boy (Default)
From: [personal profile] lian
*grabby hands* oooh that would be so, so useful!

Date: 2012-06-17 06:26 pm (UTC)
msilverstar: (Default)
From: [personal profile] msilverstar
ETA: thanks!

Also thanks for disclosing the jquery, I'm hoping that my little stream is not interesting enough for Google analytics.
Edited Date: 2012-06-17 07:20 pm (UTC)

Date: 2012-06-17 07:21 pm (UTC)
saekhwa: Asian woman with short black hair & arms outspread and text that reads: 'free' (totally awesome)
From: [personal profile] saekhwa
Oh wow, this is the coolest ever. There are ticky box options! *stares in starry-eyed wonder*

Thank you so, so much for sharing! :D

Date: 2012-06-17 07:25 pm (UTC)
msilverstar: Viggo and Sean Bean, laughing, from the Empire Awards, Feb 2009 (viggo-sean bean 09)
From: [personal profile] msilverstar
I just really appreciate knowing, so thanks again.

Date: 2012-06-17 08:46 pm (UTC)
azurelunatic: Vivid pink Alaskan wild rose. (Default)
From: [personal profile] azurelunatic
My particular setup uses If This Then That to glue Pinboard to Twitter, via the private tag ".twitter", which can be anywhere in my tags. I want to include that by default. I'm going to stare at the code for a bit to see how that should go in. :)

Date: 2012-06-17 08:50 pm (UTC)
azurelunatic: Vivid pink Alaskan wild rose. (Default)
From: [personal profile] azurelunatic
Oh, awesome, thanks!

I've been playing around in Notepad a bit, but since I don't really know what I'm doing, I'm running afoul of the separator. (It's still fun to play with; yay hacking at things!) *more enthusiasm than skill*

Date: 2012-06-18 01:03 am (UTC)
azurelunatic: Vivid pink Alaskan wild rose. (Default)
From: [personal profile] azurelunatic
Thanks! Hooray!

Date: 2012-06-18 02:10 am (UTC)
talimenios: (Default)
From: [personal profile] talimenios
You are beyond awesome. Thank you so much.

Date: 2012-06-18 12:24 pm (UTC)
stepps: stylised leaves and white flower on dark grey background (Default)
From: [personal profile] stepps
you = awesome!

Date: 2012-06-18 06:24 pm (UTC)
southerly: (Default)
From: [personal profile] southerly
This is amazing, thanks so much!

Is there any way to also include the author as a tag?
Edited Date: 2012-06-18 06:25 pm (UTC)

Date: 2012-06-18 06:57 pm (UTC)
annchi: Xie Lian with soft expression. (Kitten/Squirrel)
From: [personal profile] annchi
This is so very useful! Thank you!

Date: 2012-06-18 10:42 pm (UTC)
southerly: (Default)
From: [personal profile] southerly
Sorry! The bookmarklet is already wonderful and it is not a problem if I continue to add the author manually. That said, a choice for username or pseud sounds like a good idea.

Date: 2012-06-19 04:25 am (UTC)
hermitsoul: Archive of Our Own pirate logo icon (* ao3: stultiloquentia)
From: [personal profile] hermitsoul
This is very awesome! Do you mind if I add it to the Cool Stuff page on the FAQs?

Date: 2012-06-21 08:10 am (UTC)
hermitsoul: life is good icon (* life is good: unexpectedbox)
From: [personal profile] hermitsoul
Yay! *is selfishly glad about this addition*

Date: 2012-06-21 01:42 pm (UTC)
southerly: (Default)
From: [personal profile] southerly
It's wonderful! This will really streamline my bookmarking. Thanks again!

Date: 2012-12-31 04:50 am (UTC)
azurelunatic: Vivid pink Alaskan wild rose. (Default)
From: [personal profile] azurelunatic
I discovered an entertaining new failure mode. For a work like http://archiveofourown.org/works/575365/ (Jeeves & Wooster, tagged as if Bertie were doing the tagging himself, completely delightful and containing about a hundredweight of cucumbers), the valiant attempt to include all tags results in a woeful "Request URI is too long".

I'm planning to add a bookmarklet that does *not* attempt to pull in ALL THE TAGS, but if you can figure out how to make it cap the tags when it's going to overflow...

Date: 2013-12-09 07:42 am (UTC)
lezzerlee: Cat with glasses (Default)
From: [personal profile] lezzerlee
This is perfect, almost exactly what I was looking for. The only thing that could be better is if it included tags. Or if bookmarking on AO3 automatically send it to your pinboard along w/your bookmark comment. But that's probably near impossible w/o it being a feature of AO3. This is the next best thing!
Edited Date: 2013-12-09 07:46 am (UTC)

Date: 2020-09-15 04:59 am (UTC)
From: [personal profile] exclamations
I know it's been ages since you posted this tool, but I started playing with it last night because it was driving me crazy that the summary feature would lose line breaks on a lot of fic because of inconsistent html used in the blockquote. I ended up with the code below, after banging my head for awhile. I suspect I will need to add more replacements to the list as I encounter more paragraph formatting, but this currently gives me reliable line breaks in my fic summaries!

I also added some modifications so that I will always only get the Fic Title and Author in the title, and also strip out any extraneous parts of the url, since I only ever want to bookmark the base AO3 url.

Sorry if any of this is clumsily done - I've never played with javascript before, but I thought I'd share what I came up with anyway.

javascript:(function($){
var q=location.href;
var base = q.split("\/");
q = base[0] + "\/\/" + base[2] + "\/" + base[3] + "\/" + base[4];

var p=document.title; 
var parts = p.split("-");
if ( parts[1].startsWith(" Chapter")) {parts[1] = parts[2]}
p = parts[0] + "-" + parts[1];

var d="";
if(document.getSelection){ 
	d=document.getSelection();
}
if ( d=="" ) {
	d+=$(".summary blockquote.userstuff").html() ;
	d=d.replace(/<\/p><p>/g, '\n\n');
	d=d.replace(/<\/p>/g, '\n');
	d=d.replace(/<p>|<i>|<\/i>|<b>|<\/b>/g, '');
	d=$.trim( d );
}

var options = {"wordcount_format_text":"(%words% words)","series_include_format_text":"[%series%]"};
if ( d != '' ) { d += '\n' }
let series = $(".work.meta .series .position").map(function() { return $.trim($( this ).text()) }).get().join( ", " );
if ( series != '' ) {
	series = options.series_include_format_text.replace('%series%', series );
	d += '\n' + series; 
} 

var wc = options.wordcount_format_text.replace('%words%', $(".stats dd.words").text() );
if ( d != '' ) { d += '\n' }
d += wc; 

void(open("https://pinboard.in/add?url=" + encodeURIComponent(q) + "&description=" + encodeURIComponent(d) + "&title=" + encodeURIComponent(p), "Pinboard", "toolbar=no,width=700,height=350"));
})(jQuery);

Date: 2020-12-02 09:53 pm (UTC)
From: [personal profile] exclamations
I not sure if others might be interested in Markdown; I've never cared about the rest of the summary formatting aside from line breaks.

After further iteration, here is what I'm using now for my bookmarklet:

javascript:(function($){
var q=location.href;
var base = q.split(/[/#?]/);
if ( base[3] == "collections" ) {
	base[3] = base[5];
	base[4] = base[6];
}
q = base[0] + "\/\/" + base[2] + "\/" + base[3] + "\/" + base[4];

var p=document.title; 
var parts = p.split("-");
if ( parts[1].startsWith(" Chapter")) {
	parts[1] = parts[2]
}
p = parts[0] + "-" + parts[1];

var d="";
if(document.getSelection){ 
	d=document.getSelection();
}
if ( d=="" ) {
	d+=$(".summary blockquote.userstuff").html() ;
	d=d.replace(/<\/p><p>/g, '\n\n');
	d=d.replace(/<\/p>/g, '\n');
	d=d.replace(/<br>/g, '\n');
	d=d.replace(/<.*?>/g, '');
	d=d.replace(/&nbsp;/g, ' ');
	d=$.trim( d );
}

var options = {"wordcount_format_text":"(%words% words)","series_include_format_text":"[%series%]"};
let series = $(".work.meta .series .position").map(function() { return $.trim($( this ).text()) }).get().join( ", " );
if ( series != '' ) {
	series = options.series_include_format_text.replace('%series%', series );
	d += '\n\n' + series; 
} 

var wc = options.wordcount_format_text.replace('%words%', $(".stats dd.words").text() );
if ( d != '' ) { d += '\n' }
d += wc; 

void(open("https://pinboard.in/add?url=" + encodeURIComponent(q) + "&description=" + encodeURIComponent(d) + "&title=" + encodeURIComponent(p), "Pinboard", "toolbar=no,width=700,height=350"));})(jQuery);

Figuring out the RegExp syntax helped me get rid of most of the html code I don't care about, and my latest addition was to get rid of the occasional &nbsp;s I was seeing and strip out collections from the URL. I'm still very grateful for the base code you provided, because I never would have bothered to figure this stuff out without it.

June 2021

S M T W T F S
  12345
6789101112
1314 1516171819
20212223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 31st, 2025 02:19 am
Powered by Dreamwidth Studios