diff --git a/CHANGES.txt b/CHANGES.txt
new file mode 100644
--- /dev/null
+++ b/CHANGES.txt
@@ -0,0 +1,56 @@
+Changelog for TagSoup
+
+0.13.1
+    #562, treat <script> specially as per HTML5
+0.13
+    #616, extend to all HTML5 entities
+    Optimise lookupNamedEntity
+    Replace escapeXMLChar with escapeXML
+    Change all Entity functions to return String, not Int or Char
+0.12.7
+    Allow deepseq-1.3
+    Allow QuickCheck-2.5
+    Support bytestring-0.10 (NFData instances added)
+0.12.6
+    #515, don't crash on malformed characters (use ? instead)
+0.12.5
+    Add optRawTag to Render, to ensure script's don't get escaped
+0.12.4
+    #487, fix the behaviour of ~== for TagComment and others
+0.12.3
+    GHC 7.2 compatibility
+0.12.2
+    Add StringLike instances for Text
+0.12.1
+    Add parseOptionsEntities and improve documentation
+0.12
+    Upgrade to QuickCheck 2.4.*
+    Export toTagRep
+    Make the -download flag off by default
+    Eliminate HTTP dependency
+    Eliminate mtl dependency
+0.11.1
+    Support --flags=-download to eliminate the network dependency
+0.11
+    #326, <a "foo"> is no longer treated as an attribute
+    Add Eq/Ord instances to Tree
+    Don't mark Text.HTML.TagSoup.Tree as preliminary
+    #325, \r should be treated as whitespace
+0.10.1
+    #322, don't change ' to &apos; in render (do what the docs say)
+0.10
+    Improve the cabal file, make the test program off by default
+    Expose Text.HTML.TagSoup.Match again (was hidden accidentally)
+0.9
+    #294, let optEntityData see if there was a ';' (CHANGES API)
+    Numeric/hex entities in attributes were misparsed
+    #149, add escapeHTML function
+0.8
+    Parser now based on HTML5 specification
+    Tag is now parameterised by the string type
+0.6
+    Addition of Text.HTML.TagSoup.Tree and Text.HTML.TagSoup.Render
+    Text.HTML.TagSoup.Parser.Options renamed to ParseOptions
+    Text.HTML.TagSoup.Parser.options renamed to parseOptions
+0.4
+    Changelog started
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright Neil Mitchell 2006-2013.
+Copyright Neil Mitchell 2006-2014.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/TagSoup/Sample.hs b/TagSoup/Sample.hs
--- a/TagSoup/Sample.hs
+++ b/TagSoup/Sample.hs
@@ -47,24 +47,13 @@
 
 
 {-
-<div class="printfooter">
-<p>Retrieved from "<a href="http://haskell.org/haskellwiki/Haskell">http://haskell.org/haskellwiki/Haskell</a>"</p>
-
-<p>This page has been accessed 507,753 times. This page was last modified 08:05, 24 January 2007. Recent content is available under <a href="/haskellwiki/HaskellWiki:Copyrights" title="HaskellWiki:Copyrights">a simple permissive license</a>.</p>
-</div>
+<li id="viewcount">This page has been accessed 6,985,922 times.</li>
 -}
-haskellHitCount :: IO ()
 haskellHitCount = do
-        tags <- fmap parseTags $ openItem "http://haskell.org/haskellwiki/Haskell"
-        let count = fromFooter $ head $ sections (~== "<div class=printfooter>") tags
-        putStrLn $ "haskell.org has been hit " ++ show count ++ " times"
-    where
-        fromFooter x = read (filter isDigit num) :: Int
-            where
-                num = ss !! (i - 1)
-                Just i = findIndex (== "times.") ss
-                ss = words s
-                TagText s = sections (~== "<p>") x !! 1 !! 1
+    src <- openItem "http://haskell.org/haskellwiki/Haskell"
+    let count = fromFooter $ parseTags src
+    putStrLn $ "haskell.org has been hit " ++ count ++ " times"
+    where fromFooter = filter isDigit . innerText . take 2 . dropWhile (~/= "<li id=viewcount>")
 
 
 googleTechNews :: IO ()
@@ -88,8 +77,8 @@
 spjPapers = do
         tags <- fmap parseTags $ openItem "http://research.microsoft.com/en-us/people/simonpj/"
         let links = map f $ sections (~== "<A>") $
-                    takeWhile (~/= "<A name=haskell>") $
-                    drop 5 $ dropWhile (~/= "<A name=current>") tags
+                    takeWhile (~/= "<a name=haskell>") $
+                    drop 5 $ dropWhile (~/= "<a name=current>") tags
         putStr $ unlines links
     where
         f :: [Tag String] -> String
diff --git a/TagSoup/Test.hs b/TagSoup/Test.hs
--- a/TagSoup/Test.hs
+++ b/TagSoup/Test.hs
@@ -150,6 +150,11 @@
     parseTags "<p>some text</p\n<img alt='&lt; &yyy; &gt;' src=\"abc.gif\">" ===
         [TagOpen "p" [],TagText "some text",TagClose "p"]
 
+    parseTags "<script> if (x<bomb) </script>" === [TagOpen "script" [], TagText " if (x<bomb) ", TagClose "script"]
+    parseTags "<script> if (x<bomb) " === [TagOpen "script" [], TagText " if (x<bomb) "]
+    parseTags "<SCRIPT language=foo> if (x<bomb) </SCRIPT>" === [TagOpen "SCRIPT" [("language","foo")], TagText " if (x<bomb) ", TagClose "SCRIPT"]
+    parseTags "<script /><test>" === [TagOpen "script" [], TagClose "script", TagOpen "test" []]
+
 
 optionsTests :: Test ()
 optionsTests = check $ \(HTML x) -> all (f x) $ replicateM 3 [False,True]
diff --git a/Text/HTML/TagSoup/Specification.hs b/Text/HTML/TagSoup/Specification.hs
--- a/Text/HTML/TagSoup/Specification.hs
+++ b/Text/HTML/TagSoup/Specification.hs
@@ -19,6 +19,7 @@
 data TypeTag = TypeNormal -- <foo
              | TypeXml    -- <?foo
              | TypeDecl   -- <!foo
+             | TypeScript -- <script
                deriving Eq
 
 
@@ -50,12 +51,17 @@
 tagOpen S{..} = case hd of
     '!' -> markupDeclOpen tl
     '/' -> closeTagOpen tl
-    _ | isAlpha hd -> Tag & hd & tagName TypeNormal tl
+    _ | isAlpha hd -> Tag & hd & tagName (if isScript s then TypeScript else TypeNormal) tl
     '>' -> errSeen "<>" & '<' & '>' & dat tl
     '?' -> neilXmlTagOpen tl -- NEIL
     _ -> errSeen  "<" & '<' & dat s
 
+isScript = f "script"
+    where
+        f (c:cs) S{..} = toLower hd == c && f cs tl
+        f [] S{..} = white hd || hd == '/' || hd == '>' || hd == '?' || eof
 
+
 -- seen "<?", emitted []
 neilXmlTagOpen S{..} = pos $ case hd of
     _ | isAlpha hd -> Tag & '?' & hd & tagName TypeXml tl
@@ -70,7 +76,17 @@
 -- just seen ">" at the end, am given tl
 neilTagEnd typ S{..}
     | typ == TypeXml = pos $ errWant "?>" & TagEnd & dat s
+    | typ == TypeScript = pos $ TagEnd & neilScriptBody s
     | otherwise = pos $ TagEnd & dat s
+
+-- Inside a <script> tag, only break on </script
+neilScriptBody o@S{..}
+    | hd == '<', S{..} <- tl
+    , hd == '/', S{..} <- tl
+    , isScript s
+    = dat o
+    | eof = []
+    | otherwise =  pos $ hd & neilScriptBody tl
 
 
 -- 8.2.4.4 Close tag open state
diff --git a/tagsoup.cabal b/tagsoup.cabal
--- a/tagsoup.cabal
+++ b/tagsoup.cabal
@@ -1,7 +1,7 @@
 cabal-version:  >= 1.6
 name:           tagsoup
-version:        0.13
-copyright:      Neil Mitchell 2006-2013
+version:        0.13.1
+copyright:      Neil Mitchell 2006-2014
 author:         Neil Mitchell <ndmitchell@gmail.com>
 maintainer:     Neil Mitchell <ndmitchell@gmail.com>
 homepage:       http://community.haskell.org/~ndm/tagsoup/
@@ -10,6 +10,7 @@
 license-file:   LICENSE
 build-type:     Simple
 synopsis:       Parsing and extracting information from (possibly malformed) HTML/XML documents
+tested-with:    GHC==7.6.3, GHC==7.4.2, GHC==7.2.2
 description:
     TagSoup is a library for parsing HTML/XML. It supports the HTML 5 specification,
     and can be used to parse either well-formed XML, or unstructured and malformed HTML
@@ -18,11 +19,12 @@
     .
     Users should start from the "Text.HTML.TagSoup" module.
 extra-source-files:
+    CHANGES.txt
     tagsoup.htm
 
 source-repository head
-    type:     darcs
-    location: http://community.haskell.org/~ndm/darcs/tagsoup/
+    type:     git
+    location: https://github.com/ndmitchell/tagsoup.git
 
 flag testprog
     default: False
diff --git a/tagsoup.htm b/tagsoup.htm
--- a/tagsoup.htm
+++ b/tagsoup.htm
@@ -88,7 +88,7 @@
 
 <h3>Version History</h3>
 
-<p>A changelog is kept at <a href="http://community.haskell.org/~ndm/darcs/tagsoup/CHANGES.txt">http://community.haskell.org/~ndm/darcs/tagsoup/CHANGES.txt</a>.</p>
+<p>A changelog is kept at <a href="https://github.com/ndmitchell/tagsoup/blob/master/CHANGES.txt">https://github.com/ndmitchell/tagsoup/blob/master/CHANGES.txt</a>.</p>
 
 <h2>Potential Bugs</h2>
 
@@ -96,7 +96,7 @@
     There are two things that may go wrong with these examples:
 </p>
 <ul>
-<li><i>The Websites being scraped may change.</i> There is nothing I can do about this, but if you suspect this is the case let me know, and I'll update the examples and tutorials. I have already done so once or twice, its only a few minutes work.    </li>
+<li><i>The Websites being scraped may change.</i> There is nothing I can do about this, but if you suspect this is the case let me know, and I'll update the examples and tutorials. I have already done so several times, its only a few minutes work.</li>
     <li><i>The <tt>openURL</tt> method may not work.</i> This happens quite regularly, and depending on your server, proxies and direction of the wind, they may not work. The solution is to use <tt>wget</tt> to download the page locally, then use <tt>readFile</tt> instead. Hopefully a decent Haskell HTTP library will emerge, and that can be used instead.
     </li>
 </ul>
@@ -111,20 +111,20 @@
 <h3>Finding the Page</h3>
 
 <p>
-    We first need to find where the information is displayed, and in what format. Taking a look at the <a href="http://www.haskell.org/haskellwiki/Haskell">front web page</a>, when not logged in, you may notice that there is no hit count. However, looking at the source shows us:
+    We first need to find where the information is displayed, and in what format. Taking a look at the <a href="http://www.haskell.org/haskellwiki/Haskell">front web page</a>, when not logged in, we see:
 </p>
 <pre>
-&lt;div class="printfooter"&gt;
-&lt;p&gt;Retrieved from "&lt;a href="http://www.haskell.org/haskellwiki/Haskell"&gt;
-http://www.haskell.org/haskellwiki/Haskell&lt;/a&gt;"&lt;/p&gt;
-
-&lt;p&gt;This page has been accessed 615,165 times.
-This page was last modified 15:44, 15 March 2007.
-Recent content is available under &lt;a href="/haskellwiki/HaskellWiki:Copyrights"
-title="HaskellWiki:Copyrights"&gt;a simple permissive license&lt;/a&gt;.&lt;/p&gt;
+&lt;ul id="f-list"&gt;
+    &lt;li id="lastmod"&gt; This page was last modified on 9 September 2013, at 22:38.&lt;/li&gt;
+    &lt;li id="viewcount"&gt;This page has been accessed 6,985,922 times.&lt;/li&gt;
+    &lt;li id="copyright"&gt;Recent content is available under &lt;a href="/haskellwiki/HaskellWiki:Copyrights" title="HaskellWiki:Copyrights"&gt;a simple permissive license&lt;/a&gt;.&lt;/li&gt;
+    &lt;li id="privacy"&gt;&lt;a href="/haskellwiki/HaskellWiki:Privacy_policy" title="HaskellWiki:Privacy policy"&gt;Privacy policy&lt;/a&gt;&lt;/li&gt;
+    &lt;li id="about"&gt;&lt;a href="/haskellwiki/HaskellWiki:About" title="HaskellWiki:About"&gt;About HaskellWiki&lt;/a&gt;&lt;/li&gt;
+    &lt;li id="disclaimer"&gt;&lt;a href="/haskellwiki/HaskellWiki:General_disclaimer" title="HaskellWiki:General disclaimer"&gt;Disclaimers&lt;/a&gt;&lt;/li&gt;
+&lt;/ul&gt;
 </pre>
 <p>
-    So we see that the hit count is available, but not shown. This leads us to rule 1:
+    So we see the hit count is available. This leads us to rule 1:
 </p>
 <p class="rule">
     <b>Rule 1:</b><br/>
@@ -143,7 +143,7 @@
 
 openURL x = getResponseBody =<< simpleHTTP (getRequest x)
 
-main = do src <- openURL "http://haskell.org/haskellwiki/Haskell"
+main = do src <- openURL "http://www.haskell.org/haskellwiki/Haskell"
           writeFile "temp.htm" src
 </pre>
 <p>
@@ -155,7 +155,7 @@
     Tagsoup installs both as a library and a program. The program contains all the examples mentioned on this page, along with a few other useful functions. In order to download a URL to a file:
 </p>
 <pre>
-$ tagsoup grab http://haskell.org/haskellwiki/Haskell > temp.htm
+$ tagsoup grab http://www.haskell.org/haskellwiki/Haskell > temp.htm
 </pre>
 
 
@@ -172,35 +172,26 @@
     If the user changes their website, they will do so in unpredictable ways. They may move the page, they may put the information somewhere else, they may remove the information entirely. If you want something robust talk to the site owner, or buy the data from someone. If you try and think about design changes, you will complicate your design, and it still won't work. It is better to write an extraction method quickly, and happily rewrite it when things change.
 </p>
 <p>
-    So now, lets consider the fragment from above. It is useful to find a tag which is unique just above your snippet - something with a nice "id" property, or a "class" - something which is unlikely to occur multiple times. In the above example, "printfooter" as the class seems perfect. We decide that to find the snippet, we will start at a "div" tag, with a "class" attribute with the value "printfooter".
+    So now, lets consider the fragment from above. It is useful to find a tag which is unique just above your snippet - something with a nice "id" property, or a "class" - something which is unlikely to occur multiple times. In the above example, "viewcount" as the id seems perfect.
 </p>
 <pre>
 haskellHitCount = do
-    tags <- fmap parseTags $ openURL "http://haskell.org/haskellwiki/Haskell"
-    let count = fromFooter $ head $ sections (~== "&lt;div class=printfooter&gt;") tags
-    putStrLn $ "haskell.org has been hit " ++ show count ++ " times"
+    src &lt;- openURL "http://haskell.org/haskellwiki/Haskell"
+    let count = fromFooter $ parseTags src
+    putStrLn $ "haskell.org has been hit " ++ count ++ " times"
+    where fromFooter = filter isDigit . innerText . take 2 . dropWhile (~/= "&lt;li id=viewcount&gt;")
 </pre>
 <p>
-    Now we start writing the code! The first thing to do is open the required URL, then we parse the code into a list of <tt>Tag</tt>s. We then apply the <tt>sections</tt> function, which returns all the lists whose first element matches the query. We use the <tt>(~==)</tt> operator to construct the query - in this case asking for the "div" we mentioned earlier. This <tt>(~==)</tt> operator is very different from standard equality, it allows additional attributes to be present but does not match them. We write <tt>"&lt;div class=printfooter&gt;"</tt> as syntactic sugar for <tt>TagOpen "div" [("class","printfooter")]</tt>. If we just wanted any open tag with the given class we could have written <tt>(~== TagOpen "" [("class","printfooter")])</tt> and this would have matched. Any empty strings in the second element of the match are considered as wildcards.
-</p>
-<p>
-    Once we have a list of all matching prefixes, we take the <tt>head</tt> - assuming that only one will match. Then we apply <tt>fromFooter</tt> which needs to perform the traversal from the "printfooter" attribute onwards to the actual hit count data.
-</p>
-
-<h3>Extracting the Information</h3>
-
-<p>
-    Now we have a stream starting at the right place, we generally mangle the code using standard list operators:
+    Now we start writing the code! The first thing to do is open the required URL, then we parse the code into a list of <tt>Tag</tt>s with <tt>parseTags</tt>. The <tt>fromFooter</tt> function does the interesting thing, and can be read left to right:
 </p>
-<pre>
-fromFooter x = read (filter isDigit num) :: Int
-    where num = ss !! (i - 1)
-          Just i = findIndex (== "times.") ss
-          ss = words s
-          TagText s = sections (~== "&lt;p&gt;") x !! 1 !! 1
-</pre>
+<ul>
+	<li>First we throw away everything (<tt>dropWhile</tt>) until we get to an <tt>li</tt> tag containing <tt>id=viewcount</tt>. The <tt>(~==)</tt> operator is different from standard equality, allowing additional attributes to be present. We write <tt>"&lt;li id=viewcount&gt;"</tt> as syntactic sugar for <tt>TagOpen "li" [("id","viewcount")]</tt>. If we just wanted any open tag with the given id we could have written <tt>(~== TagOpen "" [("id","viewcount")])</tt> and this would have matched. Any empty strings in the second element of the match are considered as wildcards.</li>
+	<li>Next we take two elements, the <tt>&lt;li&gt;</tt> tag and the text node immediately following.</li>
+	<li>We call the <tt>innerText</tt> function to get all the text values from inside, which will just be the text node following the <tt>viewcount</tt>.</li>
+	<li>We keep only the numbers, getting rid of the surrounding text and the commas.</li>
+</ul>
 <p>
-    This code finds <tt>s</tt>, the text inside the appropriate paragraph by knowing that its the second (<tt>!! 1</tt>) paragraph, and within that paragraph, its the second tag - the actual text. We then split up the text using <tt>words</tt>, find the message that comes after hit count, and read all the digits we can find - filtering out the comma. I'm pretty sure this could be done better using regular expressions, and I invite a reader to submit improved code. This code may seem slightly messy, and indeed it is - often that is the nature of extracting information from a tag soup.
+	This code may seem slightly messy, and indeed it is - often that is the nature of extracting information from a tag soup.
 </p>
 <p class="rule">
     <b>Rule 3:</b><br/>
@@ -220,8 +211,8 @@
     First we spot that the page helpfully has named anchors, there is a current work anchor, and after that is one for Haskell. We can extract all the information between them with a simple <tt>take</tt>/<tt>drop</tt> pair:
 </p>
 <pre>
-takeWhile (~/= "&lt;A name=haskell&gt;") $
-drop 5 $ dropWhile (~/= "&lt;A name=current&gt;") tags
+takeWhile (~/= "&lt;a name=haskell&gt;") $
+drop 5 $ dropWhile (~/= "&lt;a name=current&gt;") tags
 </pre>
 <p>
     This code drops until you get to the "current" section, then takes until you get to the "haskell" section, ensuring we only look at the important bit of the page. Next we want to find all hyperlinks within this section:
@@ -246,8 +237,8 @@
 spjPapers = do
         tags <- fmap parseTags $ openURL "http://research.microsoft.com/en-us/people/simonpj/"
         let links = map f $ sections (~== "&lt;A&gt;") $
-                    takeWhile (~/= "&lt;A name=haskell&gt;") $
-                    drop 5 $ dropWhile (~/= "&lt;A name=current&gt;") tags
+                    takeWhile (~/= "&lt;a name=haskell&gt;") $
+                    drop 5 $ dropWhile (~/= "&lt;a name=current&gt;") tags
         putStr $ unlines links
     where
         f :: [Tag] -> String
