Archive for the ‘Blogging World’ Category

WebException and the HttpWebResponse

February 21, 2009

The following code is used to make a request and get the results:

HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://bbrown.info/");
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
StreamReader reader = new StreamReader(resp.GetResponseStream());
string contents = reader.ReadToEnd();
resp.Close();

contents will contain the HTML of this blog if the server gives a 200 OK response. Anything else will throw a WebException. You can wrap the snippet above in a try-catch to handle a non-200, but the exception is thrown in the GetResponse call so you get nothing from the actual response. 404? May as well be a 500.

Today I discovered that the WebException itself has two properties: Response and Status. This Response is the same as the resp above so you can extract out the server response in the catch.

This whole behavior of HttpWebRequest is counterintuitive in the sense that a non-200 is not an exceptional circumstance; I would have expected the response to be accessible and the status code to be populated.

Advertisements

Feed and Social Distribution Session

July 24, 2008

Talk with Jerry Cain, Ari Steinberg (Manager of News Feed Team), and Tom Whitnah.

  • Use the right channel to deliver the right message. Overview of the old ways of communication with users. Requests: when one user wants another user to take a specific action. Notifications: user-to-user to tell a user an action has been taken towards her, app-to-user to tell a user about something important to her from the application. Feed story: when a user wants to share actions they’ve taken.
  • Feed is the center of communication on Facebook. Old: single stream, not interactive, only 25 slots. New: top stories as highlights, multiple streams of news, more room for application stories to appear, commenting on stories.
  • feed.publishTemplatizedAction: disaster, user-specific token sets made aggregation very difficult.
  • New methods: feed.registerTemplateBundle and feed.publishUserAction
  • Allow template bundles to include several templates per story size, ranging from user-specific to more general. You can define different templates within a bundle to handle 1, 2, and many aggregated stories.
  • Before you launch your application, think about the sort of templates you’re going to be using. Calling the API method only allows for one-line stories. Feed forms: FB.Integration.showFeedDialog()
  • Great communications = happy users. Respect users’ attention and their friends’ attention.
  • Higher acceptance, lower ignore = more requests allocated.
  • Notifications: user-to-user, can be sent to any non-friends who are also users of the app; app-to-user, allocation is approximately seven per week per user.
  • More read, fewer hidden / spam = more notifications allocated.

Q&A

  • Allow access to News Feed? Nope.
  • Handle instead of a bundle ID? Not yet.
  • Facebook applications versus Facebook Connect? No differentiation.
  • (me) Disclose allocations per user instead of aggregate? Can put it on the short-term roadmap, but wary of disclosing who is a tattletale.
  • Statistics data available via an API call? Someone was working on that but he didn’t know the status of that work.
  • Set privacy in News Feeds? Not at this point but hopefully someday.
  • Timeline for new statistics to appear? In the next week or so.
  • Give visibility into an app’s spamminess? Talked about it with the Reviews application but have found some spamminess within the Reviews application itself.
  • What kind of history for allocation reductions? Spamminess metrics last about a month.
  • Expand News Feed on friends to see more of a story? Haven’t really thought it.
  • In stories themselves, possible to see how many times one was read in News Feed? Would like to, but not a high priority.
  • Add or view comments, available through API? Probably through fb:comments, not allow to add comments programmatically due to spam concerns.

Introducing the New Facebook Profile & More Session

July 23, 2008

Talk by Ruchi Sanghvi and Josh Elman. Here are my rough notes on the presentation:

  • The never-ending profile was the motivation behind the redesign.
  • Emphasizing feeds: increases engagement and encourage content creation
  • Simpler, cleaner profiles: easier profile navigation, clearer identity, more control
  • More control over profile: users decide about tabs, when to publish, and look of stories
  • “It all starts with the Wall”: feed, publisher, profile boxes
  • Stories: one-line, short, or full (up to 500×700). Done with feed forms, using FBML or Javascript.
  • Publisher: different versions for user and friends,
  • Info tab: deep integration with structured information, should represent information about what the user’s done. Info stuff is enabled through canvas page button using FBML or Javascript.
  • Tabs: provides the richest expression, hybrid of a profile box and canvas page (solely FBML, no advertising), no caching, 760 pixels wide, no autoplay, fb:visible-to-owner
  • Profile boxes: profile_main -> narrow, on Wall, wide and narrow appear on Boxes tab, Bookmarks will be migrated, must manually add a bookmark otherwise.
  • New permissions/lack of adding: reduces friction. First access provides user ID, friends, pic and names, publish feed stories, send requests. Add require_login to links to trigger permissions solicitation.

Q&A:

  • How do users first get into the app if they’re not adding?: About page much more static.
  • Should apps offer all integration points and let users decide or pick some?: Both, but mostly the latter.
  • Is user info going to be available to all? Still limited to privacy settings.
  • What can the Publisher do?: Rehashed already shown options
  • Smiley app? Uses shared preferences, which has been available for 9 months
  • Can you detect whether a user is in new profile? Yes, part of API.
  • Widened Wall, is it final? Yes.
  • (from me) Extended permissions, is the Wiki list definitive? Yes.
  • Engagement metrics, what are they? Bunch of them. User can reorder boxes.
  • What are these info sections? Not a mini-feed, opposite of one. More for static information. Button on canvas page shows example, the user allows it, adds it to profile, and edits inline.
  • What new stats will be available, users who have added tabs? Yes.
  • Logged in user for tabs is viewer or user? Viewer. Tabs focus should be on the user.

Benjamin Ling Presentation

July 23, 2008

Benjamin Ling, Facebook’s Director of Platform Program Management, gave a talk about the state of the platform. Here are my raw notes while listening:

  • Ecosystem isn’t just devs and users. It’s also ad networks, app dev companies, and academics
  • Guiding principles: meaningful, trustworthy, well-designed
  • Meaningful apps are: social (apps make the best use of the social graph. Example Lil’ Green Patch), useful (solve real user problems. Example Carpool), expressive (helps users share about themselves. Example Graffiti), engaging (sustain user interest. Example Who Has the Biggest Brain?)
  • Trustworthy apps are: secure (protect user data and honor privacy), respectful (value user attention and time), transparent (clearly explain features)
  • Well-designed apps are: clean (intuitive and easy to use. Example Local Picks from tripadvisor), fast (allow users to engage more), robust (stable and reliable)
  • Waiting for the hammer to drop about the consequences of these principles…
  • So what they’re going to do: 1) partner more closely with developers (garages, forum, hiring community manager—no mention of Wiki, damn); 2) keep ecosystem safe for users, fair for developers; help you create more, better apps.
  • Announcements: a) new and improved developer site; b) fbFund recipients; c) new fbFund ($2 million over next two months -> 25 semi-finalists get $25K -> users select 5 finalists, who get $250K); d) recognize apps that embody our principles (Facebook Verification—applications accepted starting September 1st, Facebook Great Apps program—more integrated experience, more content, early access—iLike and Causes); e) kill apps that violate policies; f) Facebook Connect for iPhone; g) supporting and contributing to the Open Web Fondation
  • Beta of Facebook Connect in summer, open to all users in fall

Zuckerberg Keynote

July 23, 2008

Here are my notes on the Zuckerberg keynote.

  • Start: boring.
  • Important to have a purpose behind the mission of the movement. *snore*
  • He calls it a “vacation” but he’s describing a “vision quest.”
  • An hour and a half of this. Uh oh.
  • “Mission: Give people the power to share and make the world more open and connected”
  • 90 million people are on Facebook as of July 23rd
  • 32% US, 68% international
  • Opening up the translation tools to application developers!!
  • 400,000 developers
  • Billion dollar ecosystem surrounding Facebook, if VC equaled real money
  • “Virtuous cycle of sharing” around feeds
  • iLike primarily spread and shared through feeds
  • Lessons learned from the last year: a) listen to developers more; b) build the right tools; c) need to reward good citizens and punish the bad behavers; d) simplicity and scale are important for sharing
  • Goals of next evolution: a) give people more powerful tools to share; b) Reward applications that help people share; c) Make things simpler
  • Feed sharing is contingent on enabling sharing
  • The new sharing paradigm will enable apps to allow friends to post stories to friends feeds
  • Showed the Bill O’Reilly Flips Out video
  • Demoed the new profile—without a hitch.
  • He thinks decentralization is the future. It sounds like using the Facebook API as a glue, which sounds like even less monetizable to my ears.
  • Facebook Connect is the product behind that vision
  • Goals of Connect: a) build the same kinds of apps across the Web; b) share information across the Web; c) Control your information across the Web
  • Facebook Connect demo time: Digg’s up first
  • Digg’s going to use Facebook as OpenId, essentially—an authentication source
  • Six Apart’s up: MT plugin to integrate FB with comments, also auth source, publish it onto your feed using Publisher.
  • Citysearch demo: see friends’ reviews, publish reviews to profile
  • Profile launched Monday, switchover over a period of time
  • Facebook Connect API keys available today, beta soon

Armchair Architects

May 24, 2008

In case you haven’t heard, Twitter‘s been having some alarming downtime due to scaling issues. It’s become quite popular and continues to grow significantly in both traffic and users every month. As more and more people come to rely on its unique service, these outages have grown increasingly frustrating and that has lead to a minor cottage industry in the blogosphere: complaining about Twitter and ponying up solutions to help them out of this situation.

So here’s what they need to do: shut up and realize that, by and large, they’ve got no idea what problems the Twitter team is having and no credibility in offering advice. Oh, you thought I was going to join in the chorus. While I have some experience with scaling in working in online banking and then a popular hosted blogging engine, I won’t pretend to have any special insight into the problem. Unfortunately, many of my fellow bloggers don’t share my restraint.

Just to give you an idea of the scope of the problem, Dare Obasanjo’s entry details some of the complications that become obvious after more than a superficial rumination. Some might say that attacking this is easy, but they’re dead wrong. What’s even worse, the application that the Twitter developers originally built wasn’t what it has become.

Second guessing and judging based on insufficient (or absolutely no) evidence is practically the coin of the blogosphere. Twitter needs to fix their problems, but I guarantee that their team cares more about doing so than you ever will.

[UPDATE (5/30/2008): More details.]

Talking ‘Bout My Integration

April 9, 2008

I deployed my most recent project at work today. It’s a Facebook application that allows Quick Blogcast customers to link their accounts to their Facebook profiles.

I know that bringing a blog into your Facebook profile is nothing new. There are many such applications out there right now that can do that. But I think this Quick Blogcast version is unique in that you can make it so that your friends and visitors never leave Facebook, even to comment! What’s more, we leverage nearly all of the Facebook integration points. This allows the Quick Blogcast customer to publicize his or her blog to the fullest extent while still respecting the conventions and norms of the Facebook world. While that may not sound like much, it’s been quite a learning experience for me.

For one thing, I had to master the Facebook API. Luckily, I only had to learn it secondhand because I had an excellent framework called Facebook.NET to lean on. After a month or so of experience, I even felt conversant enough to help others and supply patches. In so doing, I apparently really helped the developer of Thugz Passion, a game which I’ve grown to enjoy.

It was also a chance to get to know memcached better. I used the terrific Enyim.com Memcached framework to interact with a Win32 port of the service. I wish I knew enough C++ to move that project to the current version of the Linux original. I futilely check the danga email archives to see whether anyone’s gotten impatient with progress and just did it on their own.

I was (and am) very impressed by memcached, which is an excellent (and free) distributed caching system. ASP.NET is top-notch at scaling but its caching mechanisms (namely, the object bags like Cache, Application, and Session) can easily become bottlenecks after enough usage is thrown at them. I think memcached offers a way out—it’s certainly worked wonders in the Linux world.

I affectionately call this integration app Quick FaceBlogBookCast. It cracks me up every time; it’s easily the most cumbersome portmanteau I’ve come across. (I can’t believe I forgot the other Facebook app I released today: Domain Center for Facebook! It’s a way to spontaneously generate domain name suggestions from the information contained on your Facebook profile. The algorithms right now are pretty coarse, but I plan to refine them each and every release until they’re uncannily right some day.)

[The views expressed on this website/weblog are mine alone and do not necessarily reflect the views of Go Daddy Software, Inc.]

My Contribution

March 4, 2008

I’ve finally contributed something original to the Internet. I’ve chronicled many interesting things over at Found on the Web and I always felt like I needed to make something that others would use, get a kick out of, and then blog themselves. At last I’ve done it!

I call it the Meme Obfuscation Machine, which I just now noticed can be shortened to MOM—which I will not do. I had a spare domain that I’ve been paying for since 2003 (bridgeforsale.com) so I decided to donate it to the cause.

I created it Friday, February 29th. I’ve been intrigued by the phenomenon known as the Rick Roll for a couple of weeks now but on Friday it struck me that at some point it’s just too obvious that you’re being Rick Rolled. I remembered the serpentine redirects they used to use in the Slashdot community to land people at Goatse and suddenly it all just clicked.

It took me an hour to get all the necessary mod_rewrite rules down pat and then another hour to write up the Web site and hand-rolled feeds. The basic idea is that you craft a URL to suit your mark. For example, if your friend is a woodworking enthusiast (and who isn’t), send him a link to www.bridgeforsale.com/articles/stunning-cabinet-plans-for-free.php. He’ll gleefully click it and find himself on the business end of a Rick Astley.

I decided to make Rick Roll the default behavior for now so that any extension not already mapped (.aspx for Goatse, .jsp for Just Google It) would go to the campy video. But if you want the link to work forever, use “.php” or leave off the extension since those will be future proofed. Future meme additions will take up undefined extensions.

I hope this serves you well. Either way, I had a blast making it.

Poof Goes the Ads

November 25, 2007

When they finish the process of better and better targeted advertising, that’s when the whole idea of advertising will go poof, will disappear. If it’s perfectly targeted, it isn’t advertising, it’s information. Information is welcome, advertising is offensive. Who wants to pay to create information that’s discarded? Who wants to pay to be a nuisance? Wouldn’t it be better to pay to get the information to the people who want it? Are you afraid no one wants your information? Then maybe you’d better do some research and make a product that people actually want to know about. Dave Winer

After reading that quote from Dare Obasanjo’s recent blog entry, I was floored by its pregnancy. The best advertising—like the best sales tactics—is invisible: it is about matching someone’s needs perfectly. You’re no longer selling to them, you’re helping them and they can’t buy your product fast enough. What has the progression of advertising been but a long, slow march towards better and better targeting?

I think the end of advertising, this withering away of the message, occurs when the consumer tells the advertiser exactly what advertisement he or she wants to hear. At that point, it really is just information. For me, an excellent example was the fad of the late 90s: the personal agent. Back then, the vision was that people would create “intelligent” agents to go out and do their bidding. The consumer would say “tell me about flights with window seats going from Phoenix to LA leaving December 3rd around 4ish” and the agent would come back with details and ticket information. In reality, that’s the pinnacle of marketing—if the airline conceived the agent. Otherwise, it’s really more like a search engine or travel agent.

Like Dare, I think this is the future. The agent was an idea ahead of its time; the breathless contemporaneous accounts read more like science fiction when compared with the available technology. Technology has caught up, though, and this user-generated marketing is going to be big.

Scalping Ain’t Easy

October 9, 2007

John Gruber recently wrote:

Peter Kafka, at Silicon Alley Insider, claims the “obvious solution”
to Hannah Montana ticket scalping—wherein $67 tickets are being
re-sold for upwards of $250—is to raise the initial selling prices
of the tickets, so that the money die-hard fans are willing to pay
goes to the artist and concert promoter, rather than to the scalper,
and then to reduce the prices after the initial high-priced demand
passes.

Good advice, I say. And, of course, it’s exactly what Apple did with
the iPhone. Except Silicon Alley Insider didn’t see it that way with
the iPhone, writing “To us, this move suggests the phone is not
selling as well as Apple had hoped,” and “[The real issue] is Apple’s
obvious misjudgment of the market for a flagship product.”

The problem is that concert promoters and the venues they book at aren’t
terribly interested in maximizing their revenue from ticket sales. Their
primary concern is filling up the venues. They charge a premium for
location and a premium for certain acts, but they don’t exactly go after
the scalper market because that market actually makes the process more
efficient.

If the venue were to charge scalper-level pricing, scalpers wouldn’t buy
the tickets in order to re-sell them. The people who buy the scalper’s
inflated ticket prices may or may not pay the same amount to the venue and
the concert promoters have no idea how much people would be willing to pay
or even what the size of the market might be for these tickets. So they
price the original tickets at a level that works for them.

Scalpers then speculatively buy those tickets in the hopes that they can
make some profit through arbitrage. If they can’t move the tickets, then
they’re out the money. So they only buy what they think they can sell. The
concert venue gets to sell out (and make money from the full audience through
concession sales, programs, t-shirts, and such) and the scalper gets the
chance to make substantial profits with little effort.

Scalping is a legitimate and useful service. People just don’t like paying
more than the face value for anything.