Python Twitter-bot Framework

I’m working on a Twitter bot to be used for the upcoming episode of Mock The Movie this Thursday, and I have every intention of participating as often as humanly possible, if not the least way by running this bot when necessary.

If you’re a Python developer and are interested in building a Twitter bot, go get Tweepy and feel free to start with this framework. You’ll need to register your application with Twitter first, of course. Read the Twitter OAuth FAQ for more details.

The code for authenticating against Twitter was originally borrowed from Nessy’s Blog, but the site design that Nessy was regex’ing against to try to scrape the auth tokens out of has since changed. I’ve updated it, and included caching these tokens in plaintext files in the program folder. Nessy’s code will only run the first time.

Additionally, my bot will work in daemon mode, performing work every so many seconds according to the configuration of the iterationtime variable. You end it by hitting Ctrl-C.

To get started, enter your application consumer_key and consumer_secret, as well as the username/password for the account you’d like to connect it with. Put all the actual work you’d like to perform at the bottom, where marked with a comment. The Tweepy API specifications are very well documented, but if you’re having specific problems, I might be able to help. By the time anyone reads this and gets to that point, I’m sure I’ll have my own bot done. Good luck! Code below the fold.
Continue reading “Python Twitter-bot Framework”

Python Twitter-bot Framework
{advertisement}

Cosmos 2: Cosmic Boogaloo

The 1980 television series Cosmos, starring Carl Sagan and running 13 episodes, is one of those series that truly stands the test of time. Despite its becoming slightly dated both in terms of special effects and some of the science, it’s an excellent snapshot of what humans know about this universe as of 1980. And it appears it’s about to get a sequel, starring Neil deGrasse Tyson.

So, it’s high time someone made a sequel to it, and now someone is! In partnership with Sagan’s colleagues Ann Druyan (who is also his widow) and Steven Soter, Seth MacFarlane — yes, that Seth MacFarlane — is going to produce a new 13-part series to serve as a sequel and modern update to Sagan’s masterpiece.

Taking over the hosting duties will be none other than well-known astrophysicist Neil deGrasse Tyson, who has served as host of NOVA ScienceNOW on PBS for the past five years, so he has plenty of experience making science accessible to the general public. It would be difficult to think of anyone who would be better able to succeed the late, great Carl Sagan.

While I wholeheartedly agree that Tyson is an excellent choice for this endeavour, one of the things that I liked best about Cosmos was its unabashed humanism. It fell just short of proclaiming outright atheism, but it emphasized the primacy of the empirical, the demonstrably true, and made no bones about stating what we know to be fact and what is yet to be settled. The series made a number of statements that then were unimpeachable, but today would be frowned upon, like “evolution is a fact, the theory is just an attempt to explain the fact”.

I understand Tyson is an agnostic, and bristles occasionally that atheists like myself “claim him” as one. I argue as I always have that gnosticism and theism are different scales. The fact that he does not believe in a god makes him, like me, an agnostic atheist. It’s all a matter of which label you’re most comfortable with, honestly, and I don’t begrudge him the label he’s chosen — as a public figure in a country as rife with anti-atheist sentiment, I might do the same. My chief concern is that he represents the humanist values that Sagan espoused and held so dear. So long as that’s the case, I’m happy with this project.

Also, I really hope Seth McFarlane lives up to his obvious love of the series and does not include himself in any visible manner in the project (especially not to do voiceovers). While “Cosmos for Rednecks” might be funny on Family Guy, it has no place on what amounts to Carl Sagan’s legacy.

Of course, now I have to embed that video.

Cosmos 2: Cosmic Boogaloo

The People Vs. Dennis Markuze

Dennis Markuze, AKA Dave Mabus, has waged a one-man war against atheists and skeptics since at least 1993. He’s demonstrated a pattern of escalating behaviour, targeting first a few people whose philosophies he disagreed with, then, as time went on, expanding his spam campaign to more and more people. He started spamming PZ Myers on USENET, and others via any e-mail addresses he could get a hold of. As technology improved, he hit his stride when he realized so many atheists and skeptics were hanging out on Twitter and that he was less easily squelched there. He’s been banned from a number of local ISPs, but cannot be banned from internet cafes or public libraries. From those sanctuaries, he found that he could easily build throwaway Twitter accounts, and target a few specific people and everyone who dared talk to those people. By doing this, he manages to send a number of big names — Michael Shermer, PZ Myers, James Randi, and others — hundreds upon hundreds of direct messages a day. And everyone that these big names dares to interact with becomes a target of opportunity, splash damage in his war, whether they agree with the celebrities or not.

Lately, he’s moved on from only targeting these celebrities — they whack his accounts too fast. He’s started collecting names of people in the “middle grounds” of popularity, the “b-list” so to speak. He’s targeted me specifically, spamming me and everyone I talk to. He’s targeted Stephanie Zvan, and everyone she talks to. He’s targeted the Skepchicks, he’s targeted Monicks, he’s targeted SomeCndnSkeptic (Steve Thoms of Skeptic North), he’s targeted some of the brightest, cheeriest, happiest individuals I’ve ever had the pleasure to meet, and he’s told them that they will be exterminated.

He lives in Montreal, a major Canadian travel hub, and has on more than one occasion taken the opportunity to visit a number of atheist or skeptic conventions in order to intimidate or harass his targets in person. He’s been thrown out swiftly by security — they know him by both name and face, since one enterprising individual snapped a photo of him at a Montreal atheists convention. He has access, and drive, to physically harm people. He has not done so yet, but over the past 18+ years, he has shown a pattern of escalation that does not indicate he’s will stop.

Each of his spam tweets contains a link to his latest unhinged rant hosted at some forum that has not yet started purging his posts on sight. He has a penchant for Depeche Mode and Nostradamus. He strongly believes that those of us who believe there are probably no gods and probably no supernatural are some sort of cabal out to eliminate all those who think differently, and he’s willing to threaten anyone who he deems to be a member of this cabal with death, dismemberment, and torture. He believes Nostradamus predicted that nonbelievers would band together and rise up, and that only people like him could stop them. No other information about his life outside his delusion is present in his rants; there is nothing but the delusion in the content of his posts. And his delusion rages on.

The Montreal police once contacted Markuze. This touched off a new wave of spamming, with Markuze claiming that the police could do nothing to stop him. The Montreal police will now evidently only take complaints about Markuze from people within his district; the RCMP contacts the Montreal police where the complaints are evidently ignored. But Markuze is careful about his targets so that he’s not threatening anyone within Quebec. The local secular alliance has never heard of him. So, the police evidently won’t do anything about him. His visit to the local atheists convention is an anomaly to the pattern, and one of the big things I consider proof of escalation.

Lately, however, the Montreal police have received so many requests to take Mabus seriously that they’ve started asking people to stop tweeting them about it — evidently missing the irony. And to make the point clearer, an enterprising individual put together a petition to force the Montreal police’s hand and take his 17+ years of death threats seriously. I mean, there IS, after all, federal law against it, meaning Markuze is a criminal standing to face millions upon millions of counts of making death threats.

The petition itself is being signed repeatedly by Markuse, naturally — give him an open forum where people are looking, and he’ll flood the place with stuff like:

you want to silence me because I reveal what a BUNCH OF LYING FUCKING PIGS YOUR REALLY ARE!

@SPVM @mythbusters @snopes

what happens when God does the striking?

With, of course, a link to the latest forum post where his ever-evolving unhinged rantings have not yet been deleted.

I don’t want Markuze to go to jail. I’d prefer that he get psychiatric help. I’m not sure that he’s not already too far gone, though. Either way, it won’t happen unless you sign the petition. I already have; I was number 63. At time of writing, there are 3478 signatures. If you’ve been affected by his insanity, please, go sign. Maybe he’ll get the help he needs. One can only hope.

Update: There’s a good list of links over at Greg Laden’s, and a discussion of the actual threat level Dennis Markuze poses.

The People Vs. Dennis Markuze

How we know things in science, and how we can know things about abiogenesis

Nicked from astrobio.net on the Miller-Urey experiments. That's the actual equipment used

On this blog post over at Greg Laden’s, I’ve made a damn fine effort (if I do say so myself) at explaining the process of scientific inquiry to a pair of commenters who’ve taken issue with the idea that anyone could know anything about the event of abiogenesis — the “Origin of Life”, when the fuzzy boundary between chemicals and life was first breached — that happened on this planet. I’ve agreed with them on a number of points, including Anthony’s main thesis, that there was exactly one way that this universe’s past has unfolded, exactly one “truth” to any event in history, and that as a result, figuring out that exact truth is nearly impossible short of having been there to witness it yourself. He accuses the current scientific establishment of “decadence” (belittling our blog friend DuWayne in the process), and of “ideological materialism” wherein the elite of the scientific world are beholden to assume materialism lest their entire epistemology crumbles beneath them.

Luckily, science doesn’t work that way or we’d have stopped investigating this universe long ago.

The scientific method can be implemented to attempt to model events that it cannot prove with 100% certainty happened in exactly one way. By learning about the past, through the physical and inferential evidence we have available to us, we can develop hypotheses which are testable today. If our hypotheses about the past are correct, we can then correctly predict the results of these experiments, and if the experiments are carefully enough crafted, they can disprove the hypotheses and force us to start over. In the specific case of the abiogenesis event that occurred on this planet, we might never know the exact formula that resulted in our exact lineage. This should not stop us from taking the evidence we have available to us, the direct and inferential physical evidence that shows how this planet was very likely composed chemically in the early pre-biotic environment, and extrapolating from that knowledge that perhaps self-arranging lipids and amino acids might have formed.

The Miller-Urey experiment in 1953 took some of our best guesses about the pre-biotic environment and attempted to verify the Oparin-Haldane hypothesis that it would allow for amino acids to self-arrange. When the experiment was complete, they were proven correct. Amino acids — the building blocks to life itself — formed spontaneously, without direction, in an environment that was like science’s contemporary understanding of the early Earth. If this experiment had failed, it would have put a nail in the coffin of the abiogenesis theory, though not the last one, certainly. The fact that it succeeded suggests one of two things: 1) amino acids might spontaneously emerge in a number of environments, or 2) we got lucky and hit upon the correct way to create amino acids but did not replicate the early Earth, thus disproving abiogenesis. The former is far more likely, for obvious reasons — not ideology, but pure math. If there are a near infinite set of environments that the planet could have had, then there are a near infinite set of environments to test. The problem comes down to one of narrowing — if we know the early Earth had to have ammonia (to provide the organic compounds necessary), then we’ve excised all models that do not include ammonia. Scientists later discovered a photochemical reaction of nitrogen that would provide this ur-Earth with the necessary ammonia. Meanwhile, we narrow our options down significantly with each new piece of evidence.

The fact that better evidence turned up suggesting that the early environment was actually significantly different from the conditions replicated in the Miller-Urey experiment should thus hardly come as a surprise, though the actual early environment is still hotly debated among scientists. Miller tried again in 1983 with the newer data, but came up empty — hardly any amino acids to be found. However, Professor Jeffrey Bada repeated the experiment with an even better approximation of the early environment, e.g. that Miller’s second test had omitted iron and carbonate, and amino acids were once more formed spontaneously through nothing more than pure chemical interactions in the simulated environment. And that certainly isn’t the only such related test.

Two different environments, both resulting in amino acids. Certainly the later test benefits from the extra evidence collected about the early Earth, but getting amino acids in multiple different environments bodes well for our ability to show that every step in the grand staircase toward biology is plausible. We know that the lipid bilayer necessary to create a cell membrane can self-arrange as an emergent property of the lipid’s intrinsic hydrophobia (fear of water) on one side, hydrophilia on the other. They’ll form up all by themselves without prompting, given the right environment. So will RNA nucleotides, meaning if the RNA-world hypothesis is correct, we’re well within our rights to suggest that the hypothesis is the one that best fits the available evidence and make further predictions and experiments from there.

None of this is, you’ll notice, an attempt at building a narrative of “how things definitely happened”. People will often demand such a thing, knowing that they cannot themselves replicate experiment results, nor comprehend their interconnectedness with other such experiments if they’re even aware of these other experiments, nor suss out how all the pieces of the puzzle ultimately fit together. I understand this drive — the drive to build a narrative that is easily digested — because every human being has it. It is that drive that frees up one’s mind to contemplate other things, like immediate survival concerns or reproduction or the pursuit of leisure. It is that drive that one combats when arguing with people who cling tenaciously to their received dogmas. The temptation is great to replace one dogmatic narrative with another. But the scientific worldview demands that we understand that our understanding of this universe may never reach 100% certainty about any single topic or event, but as we slowly polish and chip away at the theories we have built, we can bring them to within impressive degrees of certainty that put any former, more dogmatic, effort at explaining the universe to shame.

The level of certainty that Andrew believes we are expressing about the study of abiogenesis is galling, and his repeated insistence that scientists are engaging in myth-making betrays his lack of understanding of the process. That we don’t know a great many things about the actual abiogenesis event on this planet means nothing, ultimately, in the study of how it might have happened. It is like asking that we know everything about the daily life of the very first ape to climb down out of the trees, or else the theory of evolution is about building a just-so narrative. I’m personally content to allow the process of scientific investigation to grind down all the possibilities until there are but a few left, and we can choose which one fits all the evidence best, until such time that new evidence overturns the model and we are forced to revisit.

That’s how science works, you see. And science does indeed work.

(To within a reasonable degree of confidence.)

How we know things in science, and how we can know things about abiogenesis

RCimT: Space roundup

A few quick Space links to cap Friday night.

On Bad Astronomy: Atlantis’ final reentry was caught from the IIS in this amazing picture. Also, an amateur astronomer managed to catch the IIS and Atlantis in broad daylight, 1.5 hrs after sunrise. Awesome!

Har har har. Courtesy of everywhere on the damned intertubes.

Speaking of amateur astronomy, this iPhone telescope clip would be awesome. If only someone would actually manufacture it! I’d buy two.

The Hubble telescope discovered a fourth moon of Pluto. Solar system’s getting crowded. Oh, and having a moon still doesn’t make you a planet.

Hanny’s Voorwerp is no longer unique in the universe. Galaxy Zoo discovered 19 more voorwerpje! (Maybe I’ll get to co-write a comic about each of them too!)

NASA has some stunning high-res pics of Vesta, an asteroid in the belt on the outskirts of our solar system and second only to the dwarf planet Ceres in mass.

And last, but certainly not least, HOLY FUCKING SHIT RUNNING WATER ON MARS. Sure, it’s just a trickle, but it’s there. Incredible. I’ll have to go into the implications another time; for now, time to get my weekend on.

RCimT: Space roundup

How we know all life shares a common origin

According to Anthony McCarthy over at Greg’s blog, extrapolating from this information to determine something about how life began on this planet is purely ideological mythmaking. Never mind that every species on the planet shares the same metabolism, by the same enzymes, which must be coded for by the same combinations of chemicals, and these chemicals must come into being by the same chemical processes. Or that as you work your way backward you can determine the lipids and amino acids that must have been how this particular origin of life happened, and that you can replicate in a laboratory the spontaneous generation of these lipids and amino acids from the pure chemicals in varying environments that are similar to, if not identical to, the best models we have of the composition of the early Earth. Meaning we have pretty much every step in the chain replicated plausibly, so even if we don’t know the exact events, we can with a fairly high degree of confidence claim that we actually know a good deal about how life probably emerged here.

Oh, he also doesn’t believe in emergence, meaning he’s never seen a fractal or snowflake under a microscope. And loves to scoff at the idea that we’re skeptics, just because we’re convinced by the evidence presented. I’ve given up on him, now that he’s decided to “copy [my words] as the most irrational series of assertions by the self-identified champions of science and reason [he’s] had the dubious privilege of reading.”

How we know all life shares a common origin