schussman.com logo

Misc & Etc

What’s in the bin this week?

  • your.flowingdata — a personal data aggregator in the same vein as daytum and mycrocosm. Flowing Data is a great site, so this tool has lots of promise. Update activities via Twitter dms.
  • Summertime in Flagstaff is just great. (The Schultz fire is now fully contained and crews are working on flood/mudslide prevention.)

Downtown after dinner

  • I’m still loving the iPad. My Lightroom 3 to iPad gallery workflow has proved to work pretty well for my needs. I’m eagerly awaiting the release of PlainText and have started to daydream about an app or web utility that would facilitate writing markdown, textile, and other markup-formatted text.
  • Shouldn’t people writing fake term papers for sale just expect that they’re going to get ripped off by douchebags?

Post to delicious with PHP and curl

This code is essentially all from Alex Schultz, reposted here for a handy local reference. I changed the api call to post, and added bits for tags and description.

When the original delicous-PHP code that I had been using stopped working, I hunted around for a new solution. There are a handful of big classes that didn’t do the trick for me, but this straightforward curl code works well. My single bookmarklet to post links to Txp and delicious is back in action.

On TextDrive Joyent servers, it’s probably necessary to enable curl support for PHP.

$dusername = USERNAME; $dpassword = PASSWORD; $api = api.del.icio.us/v1; $link = urlencode($link_url); $desc = urlencode($title); $ext = urlencode($body); $deltags = urlencode(str_replace(,, , $keywords)); $apicall = https://$dusername:$dpassword@$api/posts/add?&url=$link&description=$desc&extended=$ext&tags=$deltags; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$apicall); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_USERAGENT, php-curl); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $xml = curl_exec ($ch); curl_close ($ch);

Update: Sometimes the https certification verification causes problems. Adding “curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);” appears to solve this problem.


About, the short version

I’m a sociologist-errant. This site is powered by Textpattern, Pair Networks and the sociological imagination. For more about me and this site, see the long version.

RSS feed