Hi,

Thanks. I actually got it working in the end using:

$oauth = new OAuth
(OAUTH_CONSUMER_KEY,OAUTH_CONSUMER_SECRET,OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI);

// given that I have already upgraded my token $access_token_info

$oauth->setToken($access_token_info["oauth_token"],$access_token_info
["oauth_token_secret"]);

// do the post
$oauth->fetch($post_endpoint, $entry, OAUTH_HTTP_METHOD_POST, array
("Content-Type" => "application/atom+xml"));

where $post_host is the Blogger endpoint for creating new posts  and
$entry is simply the XHTML Atom itself.


thank goodness for the OAuthException! ;)

Kosso

On Jan 5, 11:53 pm, John Jawed <[email protected]> wrote:
> The next release of pecl/oauth will support arbitrary request headers for
> OAuth API calls via OAuth::fetch().
>
> Request headers are passed in as the last parameter to OAuth::fetch() and
> should be an array which contains a key value pair for each header you'd
> like to pass:
>
> $oauth->fetch(..., array('Content-Type' => 'application/atom+xml');
>
> This is currently undocumented (until the next release).
>
> If you would like, you can check out the upcoming release via svn, it has
> been quite stable thus far:
>
> svn checkouthttp://svn.php.net/repository/pecl/oauth/trunk./oauth
>
> Tjerk (datibbaw@) worked on this particular code and may be able to
> elaborate further.
>
> - JJ
>
> On Tue, Jan 5, 2010 at 2:25 PM, koz <[email protected]> wrote:
> > Hi,
> > I'm trying to migrate my existing AuthSub blogger posting functions
> > over to use OAuth
> > [http://code.google.com/apis/accounts/docs/OAuth_ref.html]
>
> > I now have the OAuth Pecl extension installed and working on my PHP
> > server
> > [http://us2.php.net/manual/en/book.oauth.php]
>
> > I have been able to successfully get the required Access token and
> > Secret  and Authorization to then use them to list the users' blogs in
> > order for them to choose one and store the blog id required for
> > posting.
>
> > I am now stuck at actually creating a post
>
> > Has anyone had any luck at all using the PHP Pecl extension to create
> > a new blogger post?
>
> > I know I have to send the 'extra_parameters' as as array -to the OAuth
> > call tohttp://www.blogger.com/feeds/".$blogId."/posts/default
>
> > .. to send the entry
>
> > Using AuthSub I used curl to set the Content-Type header to
> > 'application/atom+xml' along with the signed header  and add the post
> > content atom and xhtml as a post parameter to the  post url
>
> > But I have no idea how to do this with the OAuth Pecl 'fetch'
> > function.
>
> > if anyone could help or provide any pointers, that would be great
> > thanks!!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "OAuth" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected] <oauth%[email protected]>.
> > For more options, visit this group at
> >http://groups.google.com/group/oauth?hl=en.
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/oauth?hl=en.


Reply via email to