The Twilight Fortune Telling Widget (And How to Make Your Own for Any Book)

As everyone knows, Breaking Dawn will be released August 2nd. And libraries across the country will be partying until dawn. On the ya-yaac list, Dawn McMillan and the teens at the Boone County Public Library had the great idea to create Twilight Saga fortunes, based on quotes from the three books so far.

When I was a teen, I loved coding. Though it’s been over 10 years since learning Javascript and coding much of anything, I was able to use a combination of W3 Schools, Tizag Tutorials, and a hint Google searching to whip up a rudimentary widget that translates their great work into an online fortune teller.

If you want to add it to your site, simply insert the following code wherever you’d like the widget to go (to see it in action, you can take a look at the Carnegie Library of Pittsburgh’s Teen blog):

<script language=”JavaScript” src=”http://www.josephjwilk.com/twilightfortune.js”></script>

I made the script so that it will be easy for you to adapt it into a fortune teller for any book. If you download and edit the file in any text editor, you’ll find comments throughout to guide you on your way. If you’re a more advanced coding wizard, you can use this as a quick template for your own awesome designs.

Then all you need is to upload the necessary files to your library’s webspace and adapt the code above to put it on the Web.

Joseph Wilk
Carnegie Library of Pittsburgh – Teen

About Joseph Wilk

I'm a teen library assistant with the Carnegie Library of Pittsburgh's Main location. Here, I'm the graphic novel and music librarian in addition to running anime, music, LGBTQ, incarcerated youth, and video programming. I'm happy to serve YALSA as a blogger, member of the Teen Tech Week committee, and as chair of the Music Interest Group. Otherwise, you can find me in da club.
Bookmark the permalink.

4 Comments

  1. Joseph… I tried to post your widget on my blog post and it didn’t work. Just pasted the source code above and tested on two different blogs. Suggestions? Thanks!

  2. Heidi,

    There seems to be a strange glitch that occurs when copy/pasting the code from this post. Are you using Blogger? If you go back to the code, you might find two extra sets of quotation marks around “JavaScript” and the script URL. If so, remove the extra pair and it should work for you.

    Best,
    Joseph

  3. Wow!! Thank you so much! I got this installed on my blog already and I’m going to see if I can make my own for my favorite book. This is really great!!

  4. Thanks so much for creating this Joseph! It has been a huge hit with my teens!
    -Dawn

Comments are closed