rc3.org

Strong opinions, weakly held

Author: Rafe (page 70 of 989)

Not migrating Twitter scripts to OAuth

I have a number of scripts I’ve written that send updates to Twitter automatically. They are Perl scripts that run database queries and then post to Twitter using curl. Unfortunately, since Twitter turned off basic authentication they’re all dead.

Twitter ended support for basic authentication in order to prevent third party applications from asking Twitter users for their passwords. Phishing for Twitter passwords is rampant, and it’s harder to combat phishing when legitimate sites are asking Twitter users for their usernames and passwords.

While I was working on this blog post, John Udell beat me to the punch by posting about the good and bad aspects of migrating to OAuth and a technical guide to the migration.

My use case is simple, I just need to come up with an equivalent to the following code that actually works:

exec("curl -s -u $username:$password -d status=\"$tweet\" 
http://twitter.com/statuses/update.json");

When updating command line scripts to use OAuth, there are three steps. The first is registering the application with Twitter. The second is obtaining an OAuth token that the script can use. The third is updating the script to authenticate using OAuth.

Twitter’s recommendation in this case is that I stop using curl and migrate to an OAuth or Twitter library instead. To be frank, this sucks. Our servers run Red Hat Enterprise Linux and my systems administrator doesn’t like to install random Perl modules. In researching how to solve this problem, I decided to start with Net::Twitter, which has the following dependencies:

DateTime [requires]
Data::Visitor::Callback [requires]
DateTime::Format::Strptime [requires]
Net::OAuth [requires]
Moose [requires]
JSON::Any [requires]
Try::Tiny [requires]
Moose::Role [requires]
URI [requires]
namespace::autoclean [requires]
Moose::Exporter [requires]
JSON [requires]
MooseX::MultiInitArg [requires]

Those dependencies each have dependencies of their own as well. So I’m looking at moving from a script that is dependent only on the curl command line tool, which is already installed, to a script that requires dozens of Perl modules to be installed in order to work. That’s a deal breaker. As an aside, when I tried to install Net::Twitter on my Mac, the installation failed because the tests for the module didn’t pass.

Before I can even bother with registering my silly 15 line Perl script with Twitter as an application and authorize it for the account to which I submit these status updates, I have to rewrite it to use a library that I was unsuccessful in installing on my laptop and probably can’t install on the server, or I can write my own OAuth implementation from scratch to avoid getting caught in the mire of dependencies.

My Twitter script is just dead for now.

Twitter has traded simplicity for the potential for greater security. The emphasis is on the potential, because the tough part isn’t getting third party sites to migrate to OAuth, but teaching users not to give their passwords to sites that ask for them. Just because sites don’t need your password any more doesn’t mean that third parties can’t still ask for passwords or that users won’t continue to enter them when asked.

Update: My scripts started working again a few hours ago with no changes on my end. Has Twitter reenabled basic authentication temporarily?

Quotable: Salvatore Giunta

This respect that people are giving to me? This was one moment. In my battalion, I am mediocre at best. This shows how great the rest of them are.

Medal of Honor winner US Army Staff Sergeant Salvatore A. Giunta.

Apple updates the iOS app review process

The big news today is that Apple has relaxed some of the incredibly onerous restrictions they imposed on iOS applications back in April. Specifically, Apple has killed section 3.3.1, which prohibited applications built using any kind of translation or compatibility layer. They’ve also published the guidelines used in the review process, adding a layer of transparency that has been lacking thus far. I still think the review process should still be much more transparent than it is, but these are important steps forward. We can all thank Android for putting competitive pressure on Apple and outspoken developers for shaming the company for these changes.

Scott Rosenberg makes the point that while the app review process may make sense for judging applications, it’s scary as hell for people using the platform to distribute content. One thing that should be clarified is that Apple isn’t issuing new rules, it’s publishing the rules it has been applying internally. At least we have something tangible to critique, beyond just reading the tea leaves when specific applications are rejected.

The risks of using Wikipedia as a source

I am an unabashed fan of Wikipedia, but it still shouldn’t be relied upon for anything more than hobbyist-level interest in a subject. If you’re curious about the historical context for the TV series The Pillars of the Earth, Wikipedia is an outstanding resource. On the other hand, if you’re writing a news story about outbreaks of infections caused by drug-resistant bacteria in hospitals, you shouldn’t rely on what you read in Wikipedia. Science journalist Steve Silberman writes about how spurious information sourced from Wikipedia is pervasive in stories about acinetobacter, and why that bad information could cost people their lives.

Why the economy needs stimulating

Modeled Behavior explains our fundamental economic dysfunction, with charts:

This is a failure of our basic institutions of production. The job of the market is to bring together willing buyers with willing sellers in order to produce value. This is not happening and as a result literally trillions of dollars in value are not being produced.

Let me say that again because I think it fails to sink in – literally trillions of dollars in value are not being produced. Not misallocated. Not spent on programs you don’t approve of or distributed in tax cuts you don’t like. Trillions of dollars in value are not produced at all. Gone from the world entirely. Never to be had, by anyone, anywhere, at any time. Pure unadulterated loss.

This is what has bothered me for months — the opportunity cost of having so much human and industrial capacity idle. We live in a world where many, many things are needed and wanted by people, and the capacity to produce them exists but is going unused. I don’t know if another round of government spending will help or if that’s what we should do, but “stimulus” is exactly the right word for what needs to happen.

His main point is that this loss should bother everyone to the extent that they’re willing to move beyond their political hobby horses and look for a solution. That isn’t happening.

Why is corporate communication laden with BS?

Tyler Cowen takes a stab at answering a reader question about why corporate communications is laden with so much BS:

People disagree in corporations, often virulently, or they would disagree if enough real debates were allowed to reach the surface. The use of broad generalities, in rhetoric, masks such potential disagreements and helps maintain corporate order and authority. Since it is hard to oppose fluffy generalities in any very specific way, a common strategy is to stack everyone’s opinion or points into an incoherent whole. Disagreement is then less likely to become a focal point within the corporation and warring coalitions are less likely to form.

I definitely agree with his theory that financial incentives can cut through the BS:

When direct financial incentives can work well, such as in sales (bonuses) or in some parts of finance, there is much more straight talk. Disagreement and candor can flourish, because the $$ keep the workers on a common track.

The foundation of America’s success

Matthew Yglesias on the source of America’s strength:

Winning the second world war entailed building a lot of tanks and ships and warplanes and nuclear bombs. But the reason we won the war is that in the 150 years before the war, we’d gone about building the most prosperous society in human history.

The question I have these days is whether we have a government and citizenry that are capable of building a society that continues to build prosperity for the next 150 years. Like Michael O’Hare, I have my doubts.

Picking up new habits

In a post about the adoption rate for FaceTime, Marco Arment talks about the tendency of people not to use new features of devices that they already use. He explains that while people who were already using the iPhone when FaceTime was released may not get into the habit of using it, people who started using the iPhone post-FaceTime may be more likely to make regular use of it.

His post reminded me of something I think about a lot — how to get more out of the tools I already use. Most of the devices and applications we use on a day to day basis are incredibly complex. For example, I spend a lot of my day writing code in TextMate and Eclipse, and I’m certain that there are keyboard shortcuts that could make me more productive that I don’t know about, and features that would be really helpful that I never take advantage of. People often ask for features that already exist.

One resolution that I’ve made a number of times but never kept was that I’d try to build one new habit a day that will make me more productive with a tool I already use. That’s what the “tip of the day” feature that so many applications used to include was all about — giving users an opportunity to discover features that slipped past them. It’s also what Ribbon Hero, the Microsoft Office game is for. I still think this is one of the great unsolved problems in the software industry. We’re great at building powerful tools, but not so great at helping users unlock that power.

Vigilantes for politeness

Oliver Burkeman says we can all help keep society civilized by inflicting altruistic punishment on rude people that we encounter:

The study of happiness rightly focuses on such indisputable virtues as gratitude, generosity, and forgiveness. But any honest accounting of the sources of daily pleasure – for me, anyway – must include the exquisite joys of what I’ve come to think of as Politeness Enforcement Tactics: the guerrilla moves we use to avenge boorish behaviour in public places.

After reading it, I realized that I saw this sort of thing in action last weekend. I was third in line to use a communal grill, and when the person ahead of me started removing his cooked food, someone else just walked up and threw his two pork tenderloins right in the open space that I was about to use. (Rude!) The guy who was leaving apologized to me for unintentionally skipping ahead of me in line (even though he hadn’t), just to let the guy with the pork tenderloins know that people are supposed to take turns.

I’m going to look for more of these opportunities myself.

Government regulations and freedom

M.S. at the Economist’s Democracy in America blog writes about the relationship between government regulations and personal liberty. Here’s the crux of it:

But there’s another reason why I can let my daughter swim in the Amstel, and that is that I’m pretty sure that in a well-regulated country like the Netherlands, the water is reasonably free of heavy pollutants and raw sewage. (I would not, for example, let her swim in the Mekong.) This, I think, outlines a useful distinction between different kinds of regulation. I am perfectly capable of assessing for myself the risks of swimming across a small pond in Massachusetts, or the risks of swimming in the Amstel when lots of boat traffic is around. I don’t need regulations to protect me; I have common sense. What I can’t assess for myself is the risk that the water is contaminated by raw sewage. For that, I need a regulatory agency that stops households and businesses from polluting the river. To generalise: for risks I can assess myself, I don’t want regulations that prevent me from doing as I please just because I might end up suing the government. For risks I can’t assess myself, I do want regulations that give me the confidence to do as I please. One kind of regulation stops me from swimming in a pond in Massachusetts. The other kind lets me swim in a river in the Netherlands. One kind of regulation makes me less free. The other kind makes me freer.

I think that’s a great and not completely obvious point.

Older posts Newer posts

© 2024 rc3.org

Theme by Anders NorenUp ↑