Diamond Mask (Galactic Milieu Trilogy, #2)
|
|
Review:The pliocene exile saga was one of my favourite scifi bok series when I was a teenager. I had read it all in the wrong order because finding the books in Argentina was not easy. |
This is only the first part of a project to create the simplest (for me) software forum possible.
Here are the features I want:
Login using twitter / Facebook / Google / OpenID
Unlimited number of threads
Support for like / dislike both on threads and on posts
Avatars
HTML in comments
Mail the user on replies
RSS feeds for threads
You can see it in action at http://foro.netmanagers.com.ar (for a limited time only ;-)
And here is the code:
import bottle import disqusapi as disqus import json shortname = 'magicmisteryforum' api = disqus.DisqusAPI(open("key").read().strip()) @bottle.route('/', method='GET') def index(): msg = bottle.request.GET.get('msg', '') threads = api.forums.listThreads(forum=shortname, limit=100) print threads[0] return bottle.template('main.tpl', threads=threads, shortname=shortname, msg=msg) @bottle.route('/new', method='POST') def new(): title = bottle.request.forms.get('title', None) if not title: bottle.redirect('/?msg=Missing%20Thread%20Name') return thread = api.threads.create(forum=shortname, title = title) thread_id = thread.__dict__['response']['id'] # Redirecting to /thread/thread_id doesn't work # because threads take a few seconds to appear on the listing bottle.redirect('/') @bottle.route('/thread/:id') def thread(id): t = api.threads.details(thread=id) return bottle.template('thread.tpl', shortname=shortname, id=id, thread=t.__dict__['response']) @bottle.route('/static/:path#.+#') def server_static(path): return bottle.static_file(path, root='./static') app = bottle.app() app.catchall = False #Now most exceptions are re-raised within bottle. bottle.run(host='184.82.108.14', port=80, app=app)
It requires Bottle and the Disqus python API
Of course, there is also a bit of templating involved, here is main.tpl and the thread.tpl. Since I suck at HTML, it uses Bluetrip CSS and it's more than simple enough to customize.
OF COURSE I AM CHEATING!
This thing is just a simple veneer around Disqus! More like a blog with comments and without posts than a forum! But ... what's missing to make this a real forum? It works, doesn't it? You could even use Disqus categories to create subforums...
All things considered, I think it's a cute hack.
And if you wait a few days, this will lead to something much more magical!
Full source code at http://magicforum.googlecode.com
As everyone knows, there was a big quake in Japan, then a Tsunami, then a volcano erupted, then a nuclear plant caught fire. All things considered, a really crappy week.
Then again, if I were japanese and I had to read idiots telling me this was because god is pubishing me because of (whatever the idiot doesn't like about Japan), I would be sorely tempted to find the morons and ... ok, considering the japanese are showing they are very reasonable people, probably just tell him something politely.
OTOH, I am not japanese. Which means I can explain in great detail why those who say "maybe it's <whatever> punishing | telling japan <something>" are a complete waste of oxygen.
I will focus on one example, because it's a very special religious moron: a presidential candidate in Argentina, called Lilita Carrió.
Here's what she said (spanish is the original, of course):
"Dios nos está diciendo que debemos cuidar el planeta, que no sigamos destruyendo la tierra, que vivamos en la verdad, en la decencia, en la justicia, que no usemos la tecnología, aunque sea de manera pacífica. Hay que leer los signos de los tiempos"
"God is telling us that we should take care of the planet, that we should stop destroying the earth, that we should live in truth, in decency, in justice, and stop using technology, even if it's peacefully. We should read the sign of the times".
Let's consider that little by little.
"God is telling us that we should take care of the planet"
I must confess I am amazed that an almightly being is less capable of communicating ideas than my 3.9 year old kid. When he wants me to play ball, he brings the ball and tells me "Dad, let's play ball".
On the other hand, god apparently, to tell us to stop using technology, causes a series of catastrophic events in the other end of the world, then brings us the news over the Internet (a technological miracle), so that Lilita can divine god's intentions and then re-broadcast them to us over the radio (of course, an erarlier technological miracle).
Now, does that make sense to anyone? I mean, why doesn't god just, you know, say what he means in a reasonable manner? Because for religious people, the fun is in the divination. They are acting like roman priests divining the future in the entrails of an animal, except they are using the life and suffering of people.
Oh, look, suffering in Japan, that means we should stop using the Wii!
Not only is that approach completely against everything christian doctrine teaches, from with the virtue of charity (if god did it to tell us something, by definition they deserved it!) to the injunction against divining god's messages in portents (yes, it is forbidden, go ask a priest).
"[God is telling us] that we should stop destroying the earth"
Oh, gee, ok then! OTOH, maybe a more subtle way than half-breaking everything in a whole country to let us know next time? Please?
"[God is telling us] that we should live in truth"
Ok, yes, let's do that. I will start by not believing in god, who truly does not exist. When you catch up to that we'll argue some more, ok?
"[God is telling us to] stop using technology, even if it's peacefully."
I would love if this presidential candidate didn't use technology because it would mean I would not have to see her sanctimonious stupidity ever again. OTOH, if we wouldn't have technology, we would probably not know about the earthquake yet. I suppose she may have been saying "nuclear technology" and this is out of context.
OTOH, number of people killed by peaceful nuclear technology since 1950: 1000? 10000?
number of people killed by earthquakes and tsunami in the last 5 years: 100000? 200000?
Yes, those are numbers I just made up, but I am betting they are more right than wrong, so, basically, god has killed more people this week telling us not to use nuclear power, than nuclear power has killed in the last 50 years. Not exactly good communication skills.
"We should read the sign of the times"
Ok, here it is:
Don't vote for this blithering idiot. She's dangerous, and probably mentally ill.
In the spirit of the De Vicenzo web browser, I am starting a new program, called Pato Cabrera. Here are the rules:
Twitter client (no identi.ca in the first version, but to be added later)
Has these features: http://pastebin.lugmen.org.ar/6464
Has to be implemented before April 4th
Smaller than 16384 bytes (of python code) but may be larger because of artwork.
Let's see how it works :-)