Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 319 lines (292 sloc) 9.011 kb
b89f844 add a blog
Aaron Swartz authored
1 import web
01d4f8a @asldevi use db, render from settings.py consistently
asldevi authored
2 from settings import render
b89f844 add a blog
Aaron Swartz authored
3 urls = (
417b9d2 @aaronsw web.py upgrade
authored
4 '', 'reblog',
5 '/', 'index',
6 '/feed', 'feed',
7 '/(.*)', 'post',
b89f844 add a blog
Aaron Swartz authored
8 )
9
10 content = [
37c810d @aaronsw new blog post
authored
11 web.storage(
7f7e52f @aaronsw display pvs data; blog post
authored
12 slug='fecpvs',
13 title='More data!',
14 author='Aaron Swartz',
19fdd2c @aaronsw minor bug fixes
authored
15 updated='2008-07-30T00:00:00Z',
7f7e52f @aaronsw display pvs data; blog post
authored
16 body = """
17 <p>
18 We've added even more data to the site.
19 Now politician pages
20 feature data from the FEC --
21 the Federal Election Commission,
22 which tracks all usage of money in politics.
23 FEC data includes things like
24 the amount of money raised,
25 who it was raised from,
26 and so on.
27 We hope to have even more
28 (actually, a lot more)
29 FEC data soon,
30 but hopefully this provides an interesting start.
31 </p>
32
33 <p>
34 We've also added some more personal data
35 from our friends over at <a
36 href="http://votesmart.org"
37 >Project Vote Smart</a>.
38 The data includes things like
39 a politician's nickname
40 and educational history,
41 all of which we now provide on politician pages.
42 </p>
43
44 <p>
45 I hope you enjoy the new features
46 and stay tuned for some even more exciting stuff tonight
47 and later this week.
48 </p>
49 """
50 ),
51 web.storage(
238348f @aaronsw introducing devi; new blog post
authored
52 slug = 'alignment',
53 title = 'Interest Group Alignment',
54 author = 'Aaron Swartz',
19fdd2c @aaronsw minor bug fixes
authored
55 updated = '2008-06-16T00:00:00Z',
238348f @aaronsw introducing devi; new blog post
authored
56 body = """
57 <p>
58 First,
59 let me say welcome aboard to our newest team member,
60 programmer A.S.L. Devi.
61 Devi's already proved herself invaluable
62 by building our latest feature:
63 politician&mdash;interest group alignment.
64 It's a terrible name
65 (my fault; let me know if you have a better one)
66 but the idea is simple:
67 go to a page like
68 <a href="http://watchdog.net/p/mark_kirk">Mark Kirk's</a>
69 and scroll to the bottom.
70 There you'll see that Kirk is a big fan of people like
71 the National Association of Home Builders and
72 the National Association of Realtors,
73 but not the American Civil Liberties Union.
74 And for each group you can click
75 and see the votes where they agree and disagree.
76 </p>
77
78 <p>
79 Furthermore,
80 if you click on a bill and scroll to the bottom,
81 you can see all the groups that supported or opposed the bill.
82 </p>
83
84 <p>
85 It's pretty fun stuff and,
86 in my opinion,
87 awfully exciting.
88 It's all made possible thanks to our partners:
89 <a href="http://www.govtrack.us/">GovTrack.us</a>,
90 a fantastic site which provides data on bills, and
91 <a href="http://www.maplight.org/">MAPLight.org</a>,
92 a Berkeley non-profit which each summer
93 (including right now)
94 brings interns out to search the news
95 to see who is supporting and opposing
96 the bills currently before Congress.
97 </p>
98
99 <p>
100 Thanks to everyone who made this happen.
101 I hope you enjoy it!
102 </p>
103 """
104 ),
105 web.storage(
a2e928f @aaronsw add earmarks blog post
authored
106 slug = 'earmarks',
107 title = 'Earmark Info',
108 author = 'Aaron Swartz',
19fdd2c @aaronsw minor bug fixes
authored
109 updated = '2008-05-07T00:00:00Z',
a2e928f @aaronsw add earmarks blog post
authored
110 body = """
111 <p>
112 Thanks to the work of Alex Gourley
113 and data from <a href="http://taxpayer.net/">Taxpayers for Common Sense</a>,
114 politician pages now have basic information
115 about the earmarks they've requested:
116 the size and number requested
117 and the size and number eventually passed.
118 </p>
119
120 <p>
121 "Earmark" is the catch-all term for the requests
122 that Congresspeople attach to bills requiring Federal money
123 be given to particular people or places.
124 They've been in the news a lot lately,
125 criticized as a form of corruption
126 in which Congresspeople hand out money to lobbyists or campaign contributors
127 instead of letting civil servants or the bidding process handle it.
128 </p>
129
130 <p>
131 As with other Congressional perks,
132 they're not exactly distributed evenly.
133 <a href="http://watchdog.net/p/by/amt_earmark_received">Our chart</a>
92264c5 @aaronsw fix links
authored
134 shows how House leaders like
135 <a href="http://watchdog.net/p/nancy_pelosi">Nancy Pelosi</a>
136 come out on top,
a2e928f @aaronsw add earmarks blog post
authored
137 with hundreds of millions of dollars in earmarks,
92264c5 @aaronsw fix links
authored
138 while newcomers like
139 <a href="http://watchdog.net/p/laura_richardson">Laura Richardson</a>
140 get only hundreds of thousands.
a2e928f @aaronsw add earmarks blog post
authored
141 </p>
142
143 <p>
144 Whatever your feelings on earmarks,
145 we hope this data is interesting to you.
146 Thanks to Alex and Taxpayers for Common Sense for making it possible.
147 </p>
148 """
149 ),
150 web.storage(
fb2d024 @aaronsw new blog post
authored
151 slug = 'speeches',
152 title = 'Speech Data',
153 author = 'Aaron Swartz',
19fdd2c @aaronsw minor bug fixes
authored
154 updated = '2008-04-21T00:00:00Z',
fb2d024 @aaronsw new blog post
authored
155 body = """
156 <p>
157 I'm thrilled to say that Thursday,
158 just days after we launched,
159 we got our first volunteer code contribution.
160 Didier Deshommes created
161 <a href="http://github.com/dfdeshom/watchdog/">a branch on github</a>,
162 added support for parsing some data about speeches politicians have made,
163 and I pulled it and added it to the site.
164 </p>
165
166 <p>
167 Now when you visit a page like
168 <a href="http://watchdog.net/p/nancy_pelosi">Nancy Pelosi</a>
169 you can see how many times she's spoken this session
170 and the average length of her speech.
171 </p>
172
173 <p>
174 It's great to see these kinds of contributions and
175 I know there are more in the pipeline!
176 Thanks to everyone who's been pitching in.
177 </p>
178
179 <p>
180 On a darker note,
181 apologies for the outages over the weekend.
182 I think I discovered the cause of the problem
183 and it shouldn't happen again.
184 </p>
185 """
186 ),
187 web.storage(
37c810d @aaronsw new blog post
authored
188 slug = 'momentum',
189 title = 'Building Momentum',
190 author = 'Aaron Swartz',
19fdd2c @aaronsw minor bug fixes
authored
191 updated = '2008-04-16T23:48:00Z',
37c810d @aaronsw new blog post
authored
192 body = """
193 <p>
194 The response to the announcement of this little site
195 has been bigger than I ever expected.
196 Within hours after I posted about it,
197 I'd received a couple dozen emails of support --
198 some people asking how they could help,
160f7eb Typo fix in blog post.
Kragen Javier Sitaker authored
199 others sending their ideas and suggestions,
37c810d @aaronsw new blog post
authored
200 and many just saying "right on!"
201 </p>
202
203 <p>
204 I've launched dozens of sites but I've never gotten a response quite like this.
205 And I think it has to be chalked up to the power of this idea:
206 there are lots of people eager for a way to <em>get involved</em>.
207 If you want to do your part,
208 I suggest you sign up for
209 <a href="http://groups.google.com/group/watchdog-volunteers">our volunteer list</a> --
210 I'll send an email out there when we need help with something.
211 </p>
212
213 <p>
214 Perhaps the most helpful --
215 and most unexpected --
216 piece has been all the Python programmers who wrote in
217 asking how they could help.
218 The volunteers quickly ran thru everything I could think of off the top of my head
219 and I've had to go thru my todo list and start picking out things
220 I never thought I'd get to.
221 Of course that's a great problem to have
222 and <a href="http://watchdog.net/about/#feedback">we could always use more hands</a>.
223 </p>
224
225 <p>
226 And just a short while ago,
227 I did an interview with XM Satellite Radio about the project.
228 All in all, not bad for a first day.
229 </p>
230
231 <p>
232 Thanks to everyone who made it happen.
233 And let's make sure we don't lose this momentum --
234 together, let's build something great.
235 </p>
236 """
237 ),
238 web.storage(
239 slug = 'launch',
240 title = 'Welcome to watchdog.net!',
241 author = 'Aaron Swartz',
50efef2 @aaronsw fix regression
authored
242 updated = '2008-04-14T00:00:00Z',
37c810d @aaronsw new blog post
authored
243 body = """
53ec7cd @aaronsw various reformatting and cleanup
authored
244 <p>
245 It's a big election year in the US,
246 which means a lot of people have been thinking about politics lately.
247 I've been far from immune,
248 signing up for dozens of sites and reading bunches of blogs.
249 But, despite all this,
250 I feel like there's something missing:
251 a way for the average person to actually <em>get involved</em> in politics.
252 </p>
042538c @aaronsw improve blog
authored
253
53ec7cd @aaronsw various reformatting and cleanup
authored
254 <p>
255 Sure, you can be outraged over some factoid you read on a blog
256 or take part in some action campaign started by a nonprofit,
257 but that still feels like being a spectator to me.
258 Instead, I wanted to a site where you could discover the facts for yourself
259 and start your own action campaigns.
260 </p>
042538c @aaronsw improve blog
authored
261
53ec7cd @aaronsw various reformatting and cleanup
authored
262 <p>
263 Not finding one, I've decided to help build it.
42a74a4 @aaronsw absolutize links in blog post (tx phil)
authored
264 <a href="http://watchdog.net/about#people">An amazing group of people</a>
53ec7cd @aaronsw various reformatting and cleanup
authored
265 have signed on with me
42a74a4 @aaronsw absolutize links in blog post (tx phil)
authored
266 (<a href="http://watchdog.net/about#help">although we're still looking for more</a>)
53ec7cd @aaronsw various reformatting and cleanup
authored
267 and the Sunlight Network given us a grant to fund it.
268 </p>
042538c @aaronsw improve blog
authored
269
53ec7cd @aaronsw various reformatting and cleanup
authored
270 <p>
42a74a4 @aaronsw absolutize links in blog post (tx phil)
authored
271 You can read more about us and our plans on
272 <a href="http://watchdog.net/about/">the about page</a>
53ec7cd @aaronsw various reformatting and cleanup
authored
273 but for now let me just say welcome and pardon the mess.
274 We're trying to develop this site fast and in public,
275 so expect lots of changes.
276 We'll try to keep the public brokenness to a minimum,
277 but there will undoubtedly be some,
278 especially these first few weeks.
279 </p>
b89f844 add a blog
Aaron Swartz authored
280
53ec7cd @aaronsw various reformatting and cleanup
authored
281 <p>
282 And to forestall the inevitable catcalls:
283 yes, there's not much here now.
284 But we literally started officially working <em>today</em>.
285 This is just the skeleton of the site we hope to build.
286 </p>
287
288 <p>
289 Thanks for bearing with us
42a74a4 @aaronsw absolutize links in blog post (tx phil)
authored
290 and <a href="http://watchdog.net/about/#feedback">let us know what you think</a>.
53ec7cd @aaronsw various reformatting and cleanup
authored
291 </p>
37c810d @aaronsw new blog post
authored
292 """
293 )
b89f844 add a blog
Aaron Swartz authored
294 ]
295 content_mapping = dict((x.slug, x) for x in content)
296
297 class index:
298 def GET(self):
299 return render.blog_index(content)
300
301 class feed:
302 def GET(self):
303 web.header('content-type', 'application/atom+xml')
042538c @aaronsw improve blog
authored
304 lastupdate = max(x.updated for x in content)
d263d48 @aaronsw fix blog feed bug
authored
305 return render._template('blog_feed')(content, lastupdate)
b89f844 add a blog
Aaron Swartz authored
306
307 class post:
308 def GET(self, name):
309 if name in content_mapping:
310 return render.blog_post(content_mapping[name])
311 else:
23a3469 @asldevi fix crasher in notfound
asldevi authored
312 raise web.notfound()
b89f844 add a blog
Aaron Swartz authored
313
417b9d2 @aaronsw web.py upgrade
authored
314 class reblog:
315 def GET(self):
316 raise web.seeother('/')
317
b89f844 add a blog
Aaron Swartz authored
318 app = web.application(urls, globals())
Something went wrong with that request. Please try again.