Comments (8)
😢 I suppose we could place an issue here: https://github.com/haskell-infra/hl
from tagsoup.
I was thinking that a nice replacement example would be the Hackage page for this package: http://hackage.haskell.org/package/tagsoup. The example could extract the "Downloads" count from this page. I would rewrite the sample myself, but I haven't figured out how to use the package yet!
from tagsoup.
You could just switch it to the last modified date at https://wiki.haskell.org/Haskell, which contains the same markup as it did before (I think):
<ul id="f-list">
<li id="lastmod"> This page was last modified on 9 September 2013, at 22:38.</li>
<li id="copyright">Recent content is available under <a href="/HaskellWiki:Copyrights" title="HaskellWiki:Copyrights">a simple permissive license</a>.</li>
Which make the example something like:
haskellHitCount = do
src <- openURL "http://haskell.org/haskellwiki/Haskell"
let modified = fromFooter $ parseTags src
putStrLn modified
where fromFooter = innerText . take 2 . dropWhile (~/= "<li id=lastmod>")
Alternately, to get the "Downloads" count you were looking for on the hackage page, something like the following should work, I think:
let table = dropWhile (~/= "<table class=properties>") $ parseTags src
let downloads = fromTagText . head . drop 1 . dropWhile (~/= "Downloads") $ filter isTagText table
from tagsoup.
👍 for Downloads count
from tagsoup.
I'll update the example to use last modified date for now. If I have time, I'll add an example that does download count too.
from tagsoup.
@rcook It appears that https://github.com/ndmitchell/tagsoup/blob/master/TagSoup/Sample.hs is where this would go.
from tagsoup.
@theking42 : Thanks!
from tagsoup.
Thanks @rcook and @theking42 for your patches and figuring out the problem and solution. I raised #40 to use Travis to run the demos, and hopefully catch such issues before users run into them.
from tagsoup.
Related Issues (20)
- Issue about working with `OverloadedStrings` extension HOT 1
- Research language agnostic test suites
- TagPosition not updated properly before bare & character HOT 10
- Idea: Make TagTree a Monad! HOT 4
- Incorrect source position before comment. HOT 5
- Incorrect source position before bogus comment HOT 2
- Link to Samples is broken HOT 1
- Link to Java version of TagSoup is broken HOT 1
- Escape single quote (') characters as ' HOT 2
- Parsing arbitrary numerical tags HOT 1
- `tagsoup` binary no longer avaliable. HOT 1
- Modify HTML
- What is the long term status of Text.HTML.TagSoup.Tree? HOT 6
- StringLike CaseInsensitive HOT 3
- Bad tagsoup performance HOT 4
- rendering attribute with empty string value HOT 2
- `innerText` alternative with more expected spacing HOT 2
- Incorrect decoding (truncation) of `ByteString`, but not `Text` HOT 5
- `x-partial` warnings with GHC 9.8 HOT 2
- "Simon's papers" README example broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tagsoup.