Lois & Clark Fanfic Message Boards
Previous Thread
Next Thread
Print Thread
Joined: Sep 2003
Posts: 124
LaurenW Offline OP
Hack from Nowheresville
OP Offline
Hack from Nowheresville
Joined: Sep 2003
Posts: 124
Programmers, please stand down. smile

All stories on the archive are now displayed as HTML from the catalogs, so no creative solutions are necessary. 5/6/2015


If you're a Javascript programmer who can use Greasemonkey to add functionality to Web pages in Firefox, the archive has a challenge for you: Help readers more easily call up HTML versions for stories uploaded from January 2011 onward.

While the archive's goal is to eventually offer all stories in HTML from the catalog pages, we're not there yet. All stories uploaded on the site since January 2011 are available in HTML, but they're available only via the By Date and What's New pages, not the alphabetical catalog pages (by author, by title, by filename). We're going to wait to throw the switch on those pages when we've got all 3,000+ stories ready to go.

Until then, though, maybe you can help us augment the catalog pages by giving readers the option to call up the HTML versions. We use consistent pathing in our URLs, which may make this possible.

For example, to view Sue S's story "Fire Drill," which was uploaded recently, you could find it by visiting the Sue S section of the author pages and clicking to read the text version:

http://www.lcfanfic.com/stories/2014/firedril.txt

But if you were to edit the URL in your browser by typing in the html subfolder after the year folder, and changing the extension to .html, you could read the HTML version:

http://www.lcfanfic.com/stories/2014/html/firedril.html

You could tweak a URL this way for any story posted from 2011 onward. So the programming logic would be something like:

* Examine the URL of the story the user just clicked on (http://www.lcfanfic.com/stories/yyyy/xxxxxxxx.txt)

* If the number yyyy following /stories/ is greater than 2010, then insert html/ after /stories/, and change the extension of xxxxxxxx.txt to xxxxxxxx.html and display that file instead.

Is that even possible with Greasemonkey? And if so, would it be easy for us to implement on the archive?

And since we're also offering ebook versions from 2011 onward (/stories/epub/xxxxxxxx.epub and /stories/mobi/xxxxxxxx.mobi), would it be easy to offer those choices as well? That'd be handy for people browsing the site from tablets.

If you can help with this, please let me know! Or if you make a script, let us all know how we can get it.

Many thanks,

LaurenW



Last edited by LaurenW; 05/06/15 06:07 AM.
Joined: Apr 2013
Posts: 1,332
Top Banana
Offline
Top Banana
Joined: Apr 2013
Posts: 1,332
From what I read about Greasemonkey (from your Wikipedia link) this fits in its development paradigm. However Greasemonkey support/development appears to have been stopped. I am beginning to read about Kango a cross-browser extension framework that works with Chrome/IE/Firefox/Opera/Safari to accomplish the same thing. Since all of this is basically Javascript Document Object Model programming it might be doable with just plain Javascript but I will continue to look in my spare (??) time. Most of the time these frameworks exist just to make the scripting easier than just writing plain Javascript.

I am assuming we would be doing this so we would not have to go back to links and change them? I have no idea how the Archive software works, could the TOC be database driven? I have no frame of reference as to how difficult changing the links would be.

I will do more investigation into the Kango framework and see what it might be able to do for us.

Mike


Create all the happiness you are able to create.
Remove all the misery you are able to remove.

Jeremy Bentham

Joined: Sep 2003
Posts: 124
LaurenW Offline OP
Hack from Nowheresville
OP Offline
Hack from Nowheresville
Joined: Sep 2003
Posts: 124
Hi, Mike,

I am behind the times! Didn't know Greasemonkey was on its way out and Kango on the way in. So ... any Javascript/Kango programmers out there? smile

The end goal is to have the archive be database-driven, but right now it's done by hand. Going back and changing all the links in the catalogs manually would be a pain.

Many thanks for any help you can give.

Best wishes,

LaurenW

Joined: Apr 2013
Posts: 1,332
Top Banana
Offline
Top Banana
Joined: Apr 2013
Posts: 1,332
Lauren,

I will begin looking this weekend at how to do this via straight Javascript. The reason I am looking at that approach is that I was listening to a podcast this morning on the way to work and heard that Google is locking down extensions to Chrome to just those extensions that appear in the Chrome Web Store so if you install an extension such as Kango/Greasemonkey/etc that you download from SourceForge or the like Chrome will begin to ignore them since they cannot find the libraries in the Chrome Web Store. Given the security approaches the browser developers are beginning to take (and dynamically changing a URL after the click probably would be considered a hack by the security folk) this might become more difficult if not impossible to do with an extension. I will do more investigation this weekend.

Mike


Create all the happiness you are able to create.
Remove all the misery you are able to remove.

Jeremy Bentham

Joined: Sep 2003
Posts: 124
LaurenW Offline OP
Hack from Nowheresville
OP Offline
Hack from Nowheresville
Joined: Sep 2003
Posts: 124
Thanks, Mike,

I appreciate the help! Sorry to hear that Chrome may lock out "wild" browser extensions. I was envisioning the augmenting feature be available via an extension that users would control rather than be baked into the site. That way people who didn't want it wouldn't have to see it, or wait for it to kick in.

Podcasts are great. I really like consumer tech ones like "Macbreak Weekly" and "TWiT." Lately, though, I've been veering off into real estate podcasts, especially "Bigger Pockets."

Have a great weekend!

Lauren


Moderated by  bakasi, JadedEvie, Toomi8 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5