<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Help with Tumblr API keys</title>
	<link>http://ask.metafilter.com/233049/Help-with-Tumblr-API-keys/</link>
	<description>Comments on Ask MetaFilter post Help with Tumblr API keys</description>
	<pubDate>Sun, 13 Jan 2013 12:55:11 -0800</pubDate>
	<lastBuildDate>Sun, 13 Jan 2013 14:42:44 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Help with Tumblr API keys</title>
		<link>http://ask.metafilter.com/233049/Help-with-Tumblr-API-keys</link>	
		<description>When using the Tumblr API, how exactly do I get the &apos;access_token&apos; and &apos;access_secret&apos; keys I need to post through my account via a script. &lt;br /&gt;&lt;br /&gt; Howdy. I&apos;m trying to set up a PHP script that will let me take content I&apos;ve queued up and post it at regular intervals. Problem is I don&apos;t really know what I&apos;m doing. Here&apos;s where I am at:&lt;br&gt;
&lt;br&gt;
I have registered an app with Tumblr and saved my consumer_key and consumer_secret&lt;br&gt;
I have found the following &lt;a href=&quot;https://gist.github.com/1649885&quot;&gt;php function&lt;/a&gt; that seems to be what I&apos;m looking for.  &lt;br&gt;
&lt;br&gt;
To use that function I need to have my &apos;access_token&apos; and &apos;access_secret&apos; keys. My understanding is that these keys are generated when you are logged in to tumblr and then give permission  to an app to access your account. But I don&apos;t understand how to do that exactly. Basically I have a flat php script that runs off cron job and assumes you have that info already. How do I write a simple tool for my app that lets me jump through the hoop of explicitly giving my app permission and saving the resulting tokens?&lt;br&gt;
&lt;br&gt;
I see people mentioning the &quot;3-legged oauth authentication&quot; routine, which I strongly suspect is what I&apos;m looking for, but I can&apos;t seem to find an explanation on how exactly to do through that simple enough that I can grok it. &lt;br&gt;
&lt;br&gt;
Anyone care to explain it in a way that could be understood by someone who&apos;s a moderately PHP literate adult, but doesn&apos;t understand much of anything else.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2013:site.233049</guid>
		<pubDate>Sun, 13 Jan 2013 12:55:11 -0800</pubDate>
		<dc:creator>Jezztek</dc:creator>
		
			<category>PHP</category>
		
			<category>Oauth</category>
		
			<category>tumblr</category>
		
	</item>
	<item>
		<title>By: pla</title>
		<link>http://ask.metafilter.com/233049/Help-with-Tumblr-API-keys#3375125</link>	
		<description>Those come from OAuth.  Easiest way, just snoop your own session with something like Fiddler or FireBug.&lt;br&gt;
&lt;br&gt;
Less straightforward (since you&apos;ll need to modify these, but perhaps more what you want since they will work programmatically), I found about a dozen scripts to do it for Twitter (such as &lt;a href=&quot;http://stackoverflow.com/questions/10191276/twitter-getting-user-access-token-and-access-token-secret-from-aouth-token-and-s&quot;&gt;this&lt;/a&gt; or &lt;a href=&quot;http://icodesnip.com/search/click%20url/14&quot;&gt;this&lt;/a&gt;).  You could likely adapt them for Tumblr without much effort.&lt;br&gt;
&lt;br&gt;
As for the explanation, you can always do worse than &lt;a href=&quot;http://tools.ietf.org/html/rfc5849&quot;&gt;going right to the spec&lt;/a&gt;.  But in this case, I found one better... An unofficial &lt;a href=&quot;http://marktrapp.com/blog/2009/09/17/oauth-dummies&quot;&gt;OAuth for Dummies&lt;/a&gt; overview (no personal sleight intended).  :)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2013:site.233049-3375125</guid>
		<pubDate>Sun, 13 Jan 2013 14:42:44 -0800</pubDate>
		<dc:creator>pla</dc:creator>
	</item><item>
		<title>By: aparrish</title>
		<link>http://ask.metafilter.com/233049/Help-with-Tumblr-API-keys#3375456</link>	
		<description>I made &lt;a href=&quot;https://gist.github.com/4527803&quot;&gt;this script&lt;/a&gt;, which I hope will be helpful. All you need is your consumer key and consumer secret (which you can find on the &lt;a href=&quot;http://www.tumblr.com/oauth/apps&quot;&gt;Tumblr API Application page&lt;/a&gt;). It&apos;ll guide you through the process of authorizing your application, picking through the callback query string, and parsing the subsequent request to fetch the access token and access token secret.&lt;br&gt;
&lt;br&gt;
The script is written in Python. It&apos;s heavily based on &lt;a href=&quot;https://developer.linkedin.com/documents/getting-oauth-token-python&quot;&gt;this example from the LinkedIn developer docs&lt;/a&gt;&#8212;they also provide a &lt;a href=&quot;https://developer.linkedin.com/documents/getting-oauth-token-php&quot;&gt;PHP example&lt;/a&gt;, if you&apos;re interested in making your own tool in PHP.&lt;br&gt;
&lt;br&gt;
By way of explanation, the basic flow of OAuth v1 authentication is something like this:&lt;br&gt;
&lt;br&gt;
(1) Your application gets a &quot;request token&quot; from the API&apos;s request token URL, which you append to the remote service&apos;s &quot;authorize&quot; URL.&lt;br&gt;
(2) The user (in this case, you) goes to the &quot;authorize&quot; URL, with request token information on the URL; the  remote service then displays a web page which allows the user to grant your application access to their account.&lt;br&gt;
(3) The remote service then redirects the user to your application&apos;s &quot;callback URL,&quot; including an OAuth &quot;verifier&quot; on the query string.&lt;br&gt;
(4) Using a combination of the request token and the verifier string, your application can then request an &lt;i&gt;actual&lt;/i&gt; access token from the remote service.&lt;br&gt;
&lt;br&gt;
The above steps don&apos;t seem all that complicated, but the difficult part is that each of those requests from your application to the remote service need to include a signature. (The &quot;signature&quot; in this case is basically a big hash that verifies the integrity of the request, to prevent repetition and man-in-the-middle attacks.) Generating the signature is tricky and is best left to pre-baked libraries.&lt;br&gt;
&lt;br&gt;
Also, don&apos;t feel bad for not understanding all of this on your first try&#8212;OAuth v1 is an complicated, almost rube goldbergian standard that baffles users and developers alike.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2013:site.233049-3375456</guid>
		<pubDate>Sun, 13 Jan 2013 21:01:11 -0800</pubDate>
		<dc:creator>aparrish</dc:creator>
	</item><item>
		<title>By: Jezztek</title>
		<link>http://ask.metafilter.com/233049/Help-with-Tumblr-API-keys#3375512</link>	
		<description>Hey, thanks much for taking the time to help. I started trying to work things through with pla&apos;s links but once you posted your script aparrish I decided to try that out (which meant installing python and figuring out how to get oauth2 installed, which was kinda tricky for a newbie :)&lt;br&gt;
&lt;br&gt;
It seemed to work (in as much as it gave me two keys that look like what I&apos;d expect), but alas my script (the one I linked to) just keeps spitting out: {&quot;meta&quot;:{&quot;status&quot;:401,&quot;msg&quot;:&quot;Not Authorized&quot;},&quot;response&quot;:[]} &quot;.&lt;br&gt;
&lt;br&gt;
So I dunno if I got the keys wrong, or if something else is broken. Perhaps this is just out of my league for the time being.  =\</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2013:site.233049-3375512</guid>
		<pubDate>Sun, 13 Jan 2013 22:42:04 -0800</pubDate>
		<dc:creator>Jezztek</dc:creator>
	</item><item>
		<title>By: Jezztek</title>
		<link>http://ask.metafilter.com/233049/Help-with-Tumblr-API-keys#3375567</link>	
		<description>Second update. Welp, it looks like I got everything to work (I think... ). Basically I tossed out the script I has glommed on to and instead just started reading in an attempt to build the most basic version I could imagine from the bottom up instead of using a pre-made script. And what do you know, hard work actually paid off for once.&lt;br&gt;
&lt;br&gt;
Thanks again!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2013:site.233049-3375567</guid>
		<pubDate>Mon, 14 Jan 2013 02:57:45 -0800</pubDate>
		<dc:creator>Jezztek</dc:creator>
	</item>
	</channel>
</rss>
