Aug. 31st, 2009

elfs: (Default)

The correct call for posting to a user’s facebook wall with Python and pyfacebook, after you’ve established both user authentication via FacebookConnect and gotten stream_publish permission, is:

request.facebook.stream.publish(
    message = render_to_string(template_path, fb_context),
    action_links = simplejson.dumps(
        [{'text': "Check Us Out!", 'href': "http://someurl.com"}]),
    target_id = 'nf')

See that ‘nf’ down there in target_id?  It’s not on any of the Facebook documentation pages, but that is the correct string to post to your user’s facebook Newsfeed. (For that matter, the fact that you have to run the action_links through simplejson, and that they have to match the PublishUserAction API action_links spec, is also not documented; the documentation says it just needs an array of arrays.)  I have no idea how to post to some other user’s newfeed, but at least I’m one step closer.

Oh, another important tip: in order to make my news “stories” consistent, I’m using a template to post them to Facebook.  The template must not have newlines within, or they will show up on Facebook and it’ll look all ugly.  Every paragraph should be one long line of text without line breaks.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

Nicely Designed Trash
No really. I've always loved working in advertising. That's where the money is, where the art is, and where the real passion for pushing some of the web's strangest boundaries are to be found.

I'm currently bootstrapping with a small team, and the incubator is at an ad agency I can't mention for a variety of reasons. But I enjoy being here because it lets me do what I'm good at, and I get to work around a bunch of nifty people, some of whom are stressed to the max, the others of which are clever and creative as hell. Someone even bothered to nifty-up the signs on the trashcans.

But being here does remind me about one of my favorite videos of all time: When I grow up, I wanna work in advertising:



So true, all of it! Especially the part about being a web designer.

Woot. 37.

Aug. 31st, 2009 09:56 pm
elfs: (Default)
Up to 37 push-ups. Huzzah. Probably gonna plateau, or maybe do 38 on Wednesday, before I switch the rhythm to hit 42 on Friday. I was gonna go for the 42 today, but after helping a friend move this weekend my arms were aching when I started.

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 5th, 2026 11:12 am
Powered by Dreamwidth Studios