<commit_before>import web

urls = (
  '/blog/', 'index',
  '/blog/feed', 'feed',
  '/blog/(.*)', 'post',
)

render = web.template.render('templates/', base='base')

content = [
  web.storage(
    slug = 'earmarks',
    title = 'Earmark Info',
    author = '<NAME>',
    updated = '2008-05-07T00:00Z',
    body = """
<p>
Thanks to the work of <NAME>
and data from <a href="http://taxpayer.net/">Taxpayers for Common Sense</a>,
politician pages now have basic information
about the earmarks they've requested:
the size and number requested
and the size and number eventually passed.
</p>

<p>
"Earmark" is the catch-all term for the requests
that Congresspeople attach to bills requiring Federal money
be given to particular people or places.
They've been in the news a lot lately,
criticized as a form of corruption 
in which Congresspeople hand out money to lobbyists or campaign contributors
instead of letting civil servants or the bidding process handle it.
</p>

<p>
As with other Congressional perks,
they're not exactly distributed evenly.
<a href="http://watchdog.net/p/by/amt_earmark_received">Our chart</a>
shows how House leaders like <NAME> come out on top,
with hundreds of millions of dollars in earmarks,
while newcomers like <NAME> get only hundreds of thousands.
</p>

<p>
Whatever your feelings on earmarks,
we hope this data is interesting to you.
Thanks to Alex and Taxpayers for Common Sense for making it possible.
</p>
"""
  ),
  web.storage(
    slug = 'speeches',
    title = 'Speech Data',
    author = '<NAME>',
    updated = '2008-04-21T00:00Z',
    body = """
<p>
I'm thrilled to say that Thursday, 
just days after we launched, 
we got our first volunteer code contribution.
<NAME> created 
<a href="http://github.com/dfdeshom/watchdog/">a branch on github</a>,
added support for parsing some data about speeches politicians have made,
and I pulled it and added it to the site.
</p>

<p>
Now when you visit a page like 
<a href="http://watchdog.net/p/nancy_pelosi"><NAME></a>
you can see how many times she's spoken this session
and the average length of her speech.
</p>

<p>
It's great to see these kinds of contributions and 
I know there are more in the pipeline!
Thanks to everyone who's been pitching in.
</p>

<p>
On a darker note, 
apologies for the outages over the weekend. 
I think I discovered the cause of the problem
and it shouldn't happen again.
</p>
"""
  ),
  web.storage(
    slug = 'momentum',
    title = 'Building Momentum',
    author = '<NAME>',
    updated = '2008-04-16T23:48Z',
    body = """
<p>
The response to the announcement of this little site 
has been bigger than I ever expected.
Within hours after I posted about it,
I'd received a couple dozen emails of support --
some people asking how they could help,
others sending their ideas and suggestions,
and many just saying "right on!"
</p>

<p>
I've launched dozens of sites but I've never gotten a response quite like this.
And I think it has to be chalked up to the power of this idea:
there are lots of people eager for a way to <em>get involved</em>.
If you want to do your part, 
I suggest you sign up for
<a href="http://groups.google.com/group/watchdog-volunteers">our volunteer list</a> -- 
I'll send an email out there when we need help with something.
</p>

<p>
Perhaps the most helpful -- 
and most unexpected -- 
piece has been all the Python programmers who wrote in 
asking how they could help.
The volunteers quickly ran thru everything I could think of off the top of my head
and I've had to go thru my todo list and start picking out things
I never thought I'd get to.
Of course that's a great problem to have
and <a href="http://watchdog.net/about/#feedback">we could always use more hands</a>.
</p>

<p>
And just a short while ago,
I did an interview with XM Satellite Radio about the project.
All in all, not bad for a first day.
</p>

<p>
Thanks to everyone who made it happen.
And let's make sure we don't lose this momentum -- 
together, let's build something great.
</p>
"""
  ),
  web.storage(
    slug = 'launch',
    title = 'Welcome to watchdog.net!',
    author = '<NAME>',
    updated = '2008-04-14T00:00:00Z',
    body = """
<p>
It's a big election year in the US, 
which means a lot of people have been thinking about politics lately. 
I've been far from immune, 
signing up for dozens of sites and reading bunches of blogs. 
But, despite all this, 
I feel like there's something missing: 
a way for the average person to actually <em>get involved</em> in politics.
</p>

<p>
Sure, you can be outraged over some factoid you read on a blog 
or take part in some action campaign started by a nonprofit,
but that still feels like being a spectator to me. 
Instead, I wanted to a site where you could discover the facts for yourself 
and start your own action campaigns.
</p>

<p>
Not finding one, I've decided to help build it. 
<a href="http://watchdog.net/about#people">An amazing group of people</a> 
have signed on with me 
(<a href="http://watchdog.net/about#help">although we're still looking for more</a>) 
and the Sunlight Network given us a grant to fund it.
</p>

<p>
You can read more about us and our plans on 
<a href="http://watchdog.net/about/">the about page</a> 
but for now let me just say welcome and pardon the mess. 
We're trying to develop this site fast and in public, 
so expect lots of changes. 
We'll try to keep the public brokenness to a minimum, 
but there will undoubtedly be some, 
especially these first few weeks.
</p>

<p>
And to forestall the inevitable catcalls: 
yes, there's not much here now. 
But we literally started officially working <em>today</em>. 
This is just the skeleton of the site we hope to build.
</p>

<p>
Thanks for bearing with us 
and <a href="http://watchdog.net/about/#feedback">let us know what you think</a>.
</p>
"""
  )
]
content_mapping = dict((x.slug, x) for x in content)

class index:
    def GET(self):
        return render.blog_index(content)

class feed:
    def GET(self):
        web.header('content-type', 'application/atom+xml')
        lastupdate = max(x.updated for x in content)
        return render._do('blog_feed')(content, lastupdate)

class post:
    def GET(self, name):
        if name in content_mapping:
            return render.blog_post(content_mapping[name])
        else:
            raise web.notfound

app = web.application(urls, globals())
<commit_msg>fix links<commit_after>import web

urls = (
  '/blog/', 'index',
  '/blog/feed', 'feed',
  '/blog/(.*)', 'post',
)

render = web.template.render('templates/', base='base')

content = [
  web.storage(
    slug = 'earmarks',
    title = 'Earmark Info',
    author = '<NAME>',
    updated = '2008-05-07T00:00Z',
    body = """
<p>
Thanks to the work of <NAME>
and data from <a href="http://taxpayer.net/">Taxpayers for Common Sense</a>,
politician pages now have basic information
about the earmarks they've requested:
the size and number requested
and the size and number eventually passed.
</p>

<p>
"Earmark" is the catch-all term for the requests
that Congresspeople attach to bills requiring Federal money
be given to particular people or places.
They've been in the news a lot lately,
criticized as a form of corruption 
in which Congresspeople hand out money to lobbyists or campaign contributors
instead of letting civil servants or the bidding process handle it.
</p>

<p>
As with other Congressional perks,
they're not exactly distributed evenly.
<a href="http://watchdog.net/p/by/amt_earmark_received">Our chart</a>
shows how House leaders like 
<a href="http://watchdog.net/p/nancy_pelosi">Nancy Pelosi</a>
come out on top,
with hundreds of millions of dollars in earmarks,
while newcomers like 
<a href="http://watchdog.net/p/laura_richardson">Laura Richardson</a>
get only hundreds of thousands.
</p>

<p>
Whatever your feelings on earmarks,
we hope this data is interesting to you.
Thanks to Alex and Taxpayers for Common Sense for making it possible.
</p>
"""
  ),
  web.storage(
    slug = 'speeches',
    title = 'Speech Data',
    author = '<NAME>',
    updated = '2008-04-21T00:00Z',
    body = """
<p>
I'm thrilled to say that Thursday, 
just days after we launched, 
we got our first volunteer code contribution.
<NAME> created 
<a href="http://github.com/dfdeshom/watchdog/">a branch on github</a>,
added support for parsing some data about speeches politicians have made,
and I pulled it and added it to the site.
</p>

<p>
Now when you visit a page like 
<a href="http://watchdog.net/p/nancy_pelosi"><NAME></a>
you can see how many times she's spoken this session
and the average length of her speech.
</p>

<p>
It's great to see these kinds of contributions and 
I know there are more in the pipeline!
Thanks to everyone who's been pitching in.
</p>

<p>
On a darker note, 
apologies for the outages over the weekend. 
I think I discovered the cause of the problem
and it shouldn't happen again.
</p>
"""
  ),
  web.storage(
    slug = 'momentum',
    title = 'Building Momentum',
    author = '<NAME>',
    updated = '2008-04-16T23:48Z',
    body = """
<p>
The response to the announcement of this little site 
has been bigger than I ever expected.
Within hours after I posted about it,
I'd received a couple dozen emails of support --
some people asking how they could help,
others sending their ideas and suggestions,
and many just saying "right on!"
</p>

<p>
I've launched dozens of sites but I've never gotten a response quite like this.
And I think it has to be chalked up to the power of this idea:
there are lots of people eager for a way to <em>get involved</em>.
If you want to do your part, 
I suggest you sign up for
<a href="http://groups.google.com/group/watchdog-volunteers">our volunteer list</a> -- 
I'll send an email out there when we need help with something.
</p>

<p>
Perhaps the most helpful -- 
and most unexpected -- 
piece has been all the Python programmers who wrote in 
asking how they could help.
The volunteers quickly ran thru everything I could think of off the top of my head
and I've had to go thru my todo list and start picking out things
I never thought I'd get to.
Of course that's a great problem to have
and <a href="http://watchdog.net/about/#feedback">we could always use more hands</a>.
</p>

<p>
And just a short while ago,
I did an interview with XM Satellite Radio about the project.
All in all, not bad for a first day.
</p>

<p>
Thanks to everyone who made it happen.
And let's make sure we don't lose this momentum -- 
together, let's build something great.
</p>
"""
  ),
  web.storage(
    slug = 'launch',
    title = 'Welcome to watchdog.net!',
    author = '<NAME>',
    updated = '2008-04-14T00:00:00Z',
    body = """
<p>
It's a big election year in the US, 
which means a lot of people have been thinking about politics lately. 
I've been far from immune, 
signing up for dozens of sites and reading bunches of blogs. 
But, despite all this, 
I feel like there's something missing: 
a way for the average person to actually <em>get involved</em> in politics.
</p>

<p>
Sure, you can be outraged over some factoid you read on a blog 
or take part in some action campaign started by a nonprofit,
but that still feels like being a spectator to me. 
Instead, I wanted to a site where you could discover the facts for yourself 
and start your own action campaigns.
</p>

<p>
Not finding one, I've decided to help build it. 
<a href="http://watchdog.net/about#people">An amazing group of people</a> 
have signed on with me 
(<a href="http://watchdog.net/about#help">although we're still looking for more</a>) 
and the Sunlight Network given us a grant to fund it.
</p>

<p>
You can read more about us and our plans on 
<a href="http://watchdog.net/about/">the about page</a> 
but for now let me just say welcome and pardon the mess. 
We're trying to develop this site fast and in public, 
so expect lots of changes. 
We'll try to keep the public brokenness to a minimum, 
but there will undoubtedly be some, 
especially these first few weeks.
</p>

<p>
And to forestall the inevitable catcalls: 
yes, there's not much here now. 
But we literally started officially working <em>today</em>. 
This is just the skeleton of the site we hope to build.
</p>

<p>
Thanks for bearing with us 
and <a href="http://watchdog.net/about/#feedback">let us know what you think</a>.
</p>
"""
  )
]
content_mapping = dict((x.slug, x) for x in content)

class index:
    def GET(self):
        return render.blog_index(content)

class feed:
    def GET(self):
        web.header('content-type', 'application/atom+xml')
        lastupdate = max(x.updated for x in content)
        return render._do('blog_feed')(content, lastupdate)

class post:
    def GET(self, name):
        if name in content_mapping:
            return render.blog_post(content_mapping[name])
        else:
            raise web.notfound

app = web.application(urls, globals())

{'fraction_non_alphanumeric': 0.09832506203473945, 'fraction_numerical': 0.007754342431761787, 'mean_word_length': 3.642548596112311, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 151, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5050395', 'n_tokens_mistral': 4059, 'n_tokens_neox': 3878, 'n_words': 1845}