Showing posts with label SparkNotes. Show all posts
Showing posts with label SparkNotes. Show all posts

Monday, January 3, 2011

SparkNotes Compiler-Extractor

Ever find yourself in an English class in which the the text you're supposed to read is borderline incomprehensible?  Or if you're "that guy" who always needs to read supplement texts AFTER reading the original to make sure you have complete mastery of what you were supposed to read?

Either way, you probably read the SparkNotes.  Maybe you want to print them out and bring them to school so you can have a look at them in class.  Maybe your teacher is so magnanimous that he/she lets you use your notes on tests and/or quizzes.

If you fall in any of those categories, then you can find use in the SparkNotes Compiler/Extractor.  (If you're in middle school, you might not need this, but once you get into high school, SparkNotes will become your good friend, especially if you take higher-level English courses.  Or if you're just completely lazy.)  This way, you don't have to manually copy-and-paste the text (and waste a lot of time) for every SparkNotes page for every book that you're supposed to be reading.

I'd say that this program is pretty self-explanatory, but I'm the one who wrote it, so I'd think it's easy to use no matter what, right?  Here's a quick run-through of how to use the program.  You might want to just download and try the program first, and come back and read the rest of this post if you don't get it.

When you download the file ("SparkNotes Compiler-Extractor.zip"), you should extract the ZIP archive to wherever you want.  In your unzipped folder, you should have 6 items (in no particular order):

  • SparknotesCompiler.cs -- This is the source code for the program.  You can open it, read it, change it, and basically do anything you want with it except sell it!
  • c_SparknotesCompiler.bat -- Run this file to compile SparknotesCompiler.cs if you make any changes to the source code.
  • SparknotesCompiler.exe -- This is the actual program.  Run this program.
  • SparkNotes.dotx -- This is a word template I created just for these SparkNotes.  You just open the HTM document generated by Sparknotes.exe, copy all the text, and paste it into this template.  There's more to it, so read on.
  • SparkNotes.bas -- This is a Word macro for fixing up the formatting in your document.  You'll find out more about this further down the post.
  • styles.css -- This CSS file is needed for the generated HTM files to display correctly.  NOTE: The HTM files that are generated must be put in the same folder as the styles.css file!

Now you can compile/extract a SparkNotes!  First, run SparknotesCompiler.exe.  The first prompt wants you to complete a URL.  Let's compile Heart of Darkness by Joseph Conrad, for example.  To get SparkNotes's URL for that certain book, just Google it: "SparkNotes Heart of Darkness".  Probably the first one will be a link to it.  You can either click it or just use the web address that you see: "www.sparknotes.com/lit/heart".  All you have to fill out is the end of this URL, so type into the program: "lit/heart" and press [ENTER].

NOTE: If you get a URL like "http://www.sparknotes.com/lit/heart/section1.html", then just take out anything after the book's (probably abbreviated) name in the URL.  Also, don't include the forward-slash at the end, like the program tells you in case you didn't read it because you don't like to follow directions.

If you're just a normal user, then I recommend you just leave all the files extracted in the same folder, meaning that you shouldn't move them around and separate them.  You can move the entire folder if you want, just not the individual files.  That way, it helps keeps styles.css in the same folder as your HTM files.

When the program prompts you for a name, you should just enter the name without a path, such as "Heart of Darkness" or "Heart of Darkness - Conrad" or something like that.  Do not include the ".HTM" extension at the end; only put in the name.  Any characters not allowed in a normal file name are not allowed here.  The program will crash if you try something funny.

Now the program will start listing a whole bunch of URLs that it has finished getting the data from.  It'll tell you how long it took.  If you want to view the generated file right now, then press [ENTER] when the program is done (and gives you the prompt).  Otherwise just close it and maybe look at your SparkNotes later.

If you want a Word document version, then you have to do some work yourself (don't worry, it's pretty easy -- I already did most of it for you!).  First, you open up a new document based on SparkNotes.dotx by double-clicking it.  Then, you copy and paste in the text from your HTM document.  Remember to paste in the good-looking stuff that you normally read, not the HTML source code.  I'd fix up the formatting at the top a bit so that the book's title and author's name take up less space, but that's just my personal preference.  Next, you should change the name in the header (on the second page) to display the correct book title and author name in the corresponding places.

Here's something you might learn now: Word macros.  If you don't know what they are, it's OK because I already made it for you.  Because this post is already so long, I won't post the actual code here.

Here are the instructions for Word 2007.  If you have a different version of Word, it's probably pretty similar.  First, go to "View' on the ribbon and click "Macros" --> "View Macros" on the right.  Or, Alt - W - M - V is the Office 2007 shortcut for you.  Then, type in the name of the macro we're going to use.  For this one, I recommend something like "SparkNotes".  Then click the "Create" button.  It'll bring up this code screen.  But don't be afraid!  Click "File" --> "Import File..." and navigate to the folder where this program is.  Select "SparkNotes.bas".  Save and close the code window and go back to your Word document.  Go view your macros again.  This time, select "SparkNotes" and click "Run".  It will format your document for you.  I think that you only have to do this once, because it will save the macro with Word.  How useful!  You don't have to save this word document with the rest of the HTM files, styles.css, and the other files because Word has it's own independent formatting now.  It has no dependencies on other files!

If you're OK with a Word document (which you probably are), then you're fine.  If you want to make a PDF out of it, I recommend that you get CutePDF Writer.  It's a great, easy-to-install, free tool.  You can save/move the PDF files anywhere you want, just like the Word documents.  Just remember to keep the 6 downloaded files and the generated HTM files together!

That's all... it was pretty easy, wasn't it?  You didn't need those instructions -- you probably think I am insulting your intelligence right now!

If you didn't find the link in that massive bulk of text above, here it is again:

Monday, December 20, 2010

No Fear Literature - ALL

Remember the old post on No Fear Shakespeare?  If you do, then that's great!  If you don't then you should go read it (see No Fear Shakespeare - ALL).  Well, I found out that SparkNotes has "No Fear" titles not only for Shakespeare plays, but also for a few other books, such as the scary The Scarlet Letter or the terrifying Beowulf.  It's called No Fear Literature!

Since I already had the code for compiling all of the "No Fear Shakespeare" plays, all I had to do was make a few modifications to the code to make it compile the other plays.  It was a bit more of a pain getting these five works because the formatting of these URLs was much less standard between each other.  However, it could be done, as we see now!  (If you're still expecting the code, it's so un-standard, meaning that you have to tweak it for nearly every book, that I don't think anybody actually wants it so I probably will never release it.  Besides, every single "No Fear" book has been compiled now.)

As of now, SparkNotes only has six "No Fear Literature" books (I'm too lazy to actually finish A Tale of Two Cities because it would require quite a lot of code-tweaking).  If you actually need (or want) the "No Fear Literature" version of this play to be compiled, then leave a comment and I'll try to get around to uploading it as soon as possible.

Remember: THE TEXT IS NOT MINE!  IT'S ALL FROM SPARKNOTES!

If you like these "No Fear" compilations, please tell your friends and link them to this blog!  That gives me more web traffic, which increases my happiness!

If you haven't already, read the bulleted list in No Fear Shakespeare - ALL before downloading the files.  There are a few things in there that you should know.

Here's the link you've been waiting for:
http://www.mediafire.com/?b2n498laiyznz

Wednesday, December 8, 2010

No Fear Shakespeare - ALL

It all started with Hamlet (see No Fear Shakespeare - Hamlet for more details).  I figured that since I could make one of these, I could do the rest.  All it would take would be a more general program and some "skillz" at using Microsoft Word.

Again, I'm sorry, but no source code will be released at this point.  It's a bit neater than it was when I was extracting Hamlet, but it's still difficult to explain.  Maybe I'll just release it in its unpolished form sometime.  But it doesn't really matter because the program has already done its job.  All of the No Fear Shakespeare plays have been extracted and converted into these files.

Here's a quick overview of what I did, if you care.  First, I saved an example of a No Fear Shakespeare webpage from some random play (probably Macbeth).  Then, I played with the HTML until I knew what I needed to extract and what other things to keep and what to delete.  I wrote a C# program to extract this stuff and compile a .HTM file (a.k.a. just a webpage).  Then, I copied all the text in this formatted .HTM file and pasted it into a word template I made just for these No Fear Shakespeare plays, preserving the source formatting.  It still didn't look great, so I created a VB macro in Word to touch up the text.  Since I was using my slow laptop, it took a while to paste and format such large volumes of text.

Now you can go download all of the files, and here are some things you should know first:
  • You can get specific Word 2007 (.DOCX) or .PDF files by going into the different folders for the different plays.
  • The .DOCX files are smaller, but you'll need something to read it, but I think the .PDF files seem more professional.
  • You CAN edit the .DOCX files, but you CANNOT edit the .PDF files.
  • "No Fear Shakespeare WORD2007.zip" contains only the .DOCX files for each of the plays.
  • "No Fear Shakespeare PDF.zip" contains only the .PDF files for each of the plays.
  • "No Fear Shakespeare HTML.zip" contains only the HTML files for each of the plays.  HTML is by far the smallest format, and is the best if you are reading on the computer (printing the HTML file makes it really small and the formatting is kind of funny).  You MUST all of the .HTM files in the same folder as the "No Fear Shakespeare  Macbeth  Act 1, Scene 1_files" folder and the ""No Fear Shakespeare  Macbeth  Act 1, Scene 1_files.htm" file because they contains all the scripts used in displaying the .HTM files correctly.
  • "No Fear Shakespeare ALL.zip" contains all of the files.  You still have the keep the .HTM files in the same long-named folder with the scripts.
Remember, THE TEXT IS NOT MINE!  IT IS ALL FROM SPARKNOTES!

All of these files are kind of long (they're full plays with Modern English translations), so printing them out will use a lot of paper.  But it's still better than buying the No Fear Shakespeare book from SparkNotes (in my opinion).

If you liked this, don't forget to tell your friends!  Please link them to this blog first instead of giving them a direct link, because it increases the traffic on this site, which makes me happy!

Have fun reading Shakespeare (if that's possible).  Believe me, the No Fear Shakespeare version is countless times easier to read than the real thing!

So, without further ado, here's the link to download those files:

Sunday, December 5, 2010

No Fear Shakespeare - Hamlet

We all know how much of a pain it is to read Shakespeare.  Thank goodness SparkNotes came up with their "No Fear Shakespeare" series.  It basically translates all the old English gibberish to modern day English!  SparkNotes even makes it free to view online.

The problem is that viewing online requires you to have an Internet connection with lots of distracting link and an annoying background.  SparkNotes gives you the option to purchase the "No Fear Shakespeare" book from places like Barnes and Noble or as an iPod app, but it costs MONEY!

So I decided to write a program to extract all of "No Fear Shakespeare - Hamlet" into a document viewable document on your computer!  No more pesky advertisements!  No more annoying background!  Just plain text on a plain white background for your reading pleasure (if reading Shakespeare could be a pleasure).  You can even print it out and use it, as if you had the REAL "No Fear Shakespeare" version, but just so you know, it's a lot of paper!

Sorry, but the source code will not be released right now, not because I care about other people stealing my ideas, but because it's very unrefined, and my extraction method was rather crude.  One thing that everybody can learn is how to download HTML code using C#:

WebClient wc = new WebClient();
string html = wc.DownloadString("put_website_url_here");

If it's not obvious enough, put the website URL as a string in the parameter of the DownloadString(...) method.  Then you get all of the HTML code as a string.  In a nutshell, I used that code example to get the HTML for all the parts of "No Fear Shakespeare - Hamlet" that I needed, put it in the correct SparkNotes format, and exported it to a Word document.  Then, I used CutePDF (it's free!) to convert that Word document into a .PDF file.

I don't even know how legal this is, so I'm going to make this loud and clear:
THE ACTUAL WORK IS NOT MY OWN!  ALL I DID WAS COMPILE IT INTO AN EASY-TO-READ FORMAT.

I'll even include an MLA citation:
Crowther, John, ed. “No Fear Hamlet.” SparkNotes.com. SparkNotes LLC. 2005. Web. 1 Dec. 2010.

I didn't do any formatting, so sometimes the line breaks are at very inconvenient locations and the overall layout of the document may not be super-visually-appealing.  Sometimes the spaces between words get screwed up.  The line numbering is also kind of sporadic.  If anybody wants to, then please download the Word document and make the necessary changes, such as getting rid of "Original Text" and "Modern Text" so it doesn't appear so much.  It may also be nice to make the font size on the headers bigger.  It'd be great to make sure the page breaks are in nicer places.  If you're bored, I'd appreciate it if you would be willing to help fix up the document.  Or, if you're reading off the Word document, you can fix up the document as you read.  Another thing: I don't really know how to add bookmarks for the Acts and Scenes in Adobe Reader, so if you want to do that, thank in advance!  If you do actually help fix up the stuff, leave a comment or email me.  UPDATE: I fixed some of the formatting.  It looks less crude and more professional now!

Alright, thanks for reading all my blabbering (but that's OK if you just skipped down here).  You can download either the Word document or the .PDF file at the following link:
http://www.mediafire.com/?9q04an5o3hhoi

If you're going to use this or tell your friends, please link them to this blog page first so I get more traffic!  Thanks a ton!

UPDATE:  I have uploaded all of the No Fear Shakespeare plays!  Click here to see No Fear Shakespeare - ALL

* Note: Just because I don't like Shakespeare doesn't mean other people can't enjoy his works.  So please don't hate on me for hating on Shakespeare =P (besides, he probably wrote his plays to torture 21st century high-schoolers anyway!).


*** Disclaimer: You may NOT distribute the stuff for money.  You didn't make those files yourself, and you definitely didn't write the content.  If you started selling this and Sparknotes took off their free online version of "No Fear Shakespeare," then we'd all be screwed!