Re: [twitter-dev] Tweeting with Net::Twitter + OAuth

2010-09-30 Thread Neal Rauhauser
   I do things precisely in this fashion, works fine for me. Contact me here
and I'll look your stuff over if Marc does not get to it first ...

  It's better to use nrauhau...@gmail.com as opposed to this, which is a
very large junk box for me.


On Fri, Sep 10, 2010 at 4:37 AM, wkossen w.kos...@gmail.com wrote:


 What am I doing wrong here?
 trying to tweet an url and a text to an account...

 #!/usr/bin/perl

 use Net::Twitter;

 # necessary strings are available in environment...
 $iurl = $ENV{iurl};
 $itxt = $ENV{itxt};
 $ckey = $ENV{ckey};
 $csec = $ENV{csec};
 $atok = $ENV{atok};
 $asec = $ENV{asec};

 # this used to work in pre-oauth days...
 # my $twit = Net::Twitter-new(username=$iusr, password=$ipas );
 # $result = $twit-update($iurl. .$itxt);

 my $client = Net::Twitter-new(
consumer_key = $ckey,
consumer_secret = $csec,
access_token = $atok,
access_secret = $asec,
 );


 $tweet=$iurl. .$itxt;

 my $res = $client-update({ status = $tweet });

 it doesn't work and I'm no development whizzz.

 --
 Twitter developer documentation and resources: http://dev.twitter.com/doc
 API updates via Twitter: http://twitter.com/twitterapi
 Issues/Enhancements Tracker:
 http://code.google.com/p/twitter-api/issues/list
 Change your membership to this group:
 http://groups.google.com/group/twitter-development-talk?hl=en


-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


Re: [twitter-dev] Tweeting with Net::Twitter + OAuth

2010-09-30 Thread Willem Kossen
Let's just show the whole script here for easier debugging...

#!/usr/bin/perl
use strict;
use Net::Twitter;
use Scalar::Util 'blessed';
use warnings;

my $wikiurl;
my $wikitxt;
my $wikckey;
my $wikcsec;
my $wikatok;
my $wikasec;
my $client;
my $tweet;

$wikiurl = $ENV{wikiurl};
$wikitxt = $ENV{wikitxt};

$wikckey = $ENV{wikckey};
$wikcsec = $ENV{wikcsec};
$wikatok = $ENV{wikatok};
$wikasec = $ENV{wikasec};

#debugging:
print keys are\n;
print $wikckey\n;
print $wikcsec\n;
print $wikatok\n;
print $wikasec\n;

my $client = Net::Twitter-new(legacy = 0);

#traits = ['OAuth', 'API::REST'],
my $client = Net::Twitter-new(
traits = [qw/OAuth API::REST/],
consumer_key = '$wikckey',
consumer_secret = '$wikcsec',
access_token = '$wikatok',
access_token_secret = '$wikasec',
);

#binmode STDOUT, :utf8;

$tweet = $wikiurl. .$wikitxt;
#debugging:
print $tweet\n;

my $res = $client-update('Hello');
#my $res = $client-update({ status = $tweet });

print Tweeted: http://twitter.com/$res-
{user}{screen_name}/status/$res-{id}\n;




Willem Kossen
wDOTkossenATgmailPUNKTcom

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Tweeting with Net::Twitter + OAuth

2010-09-10 Thread wkossen

What am I doing wrong here?
trying to tweet an url and a text to an account...

#!/usr/bin/perl

use Net::Twitter;

# necessary strings are available in environment...
$iurl = $ENV{iurl};
$itxt = $ENV{itxt};
$ckey = $ENV{ckey};
$csec = $ENV{csec};
$atok = $ENV{atok};
$asec = $ENV{asec};

# this used to work in pre-oauth days...
# my $twit = Net::Twitter-new(username=$iusr, password=$ipas );
# $result = $twit-update($iurl. .$itxt);

my $client = Net::Twitter-new(
consumer_key = $ckey,
consumer_secret = $csec,
access_token = $atok,
access_secret = $asec,
);


$tweet=$iurl. .$itxt;

my $res = $client-update({ status = $tweet });

it doesn't work and I'm no development whizzz.

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en


Re: [twitter-dev] Tweeting with Net::Twitter + OAuth

2010-09-10 Thread Marc Mims
* wkossen w.kos...@gmail.com [100910 06:45]:
 
 my $client = Net::Twitter-new(
 consumer_key = $ckey,
 consumer_secret = $csec,
 access_token = $atok,
 access_secret = $asec,
 );

You need to include the OAuth trait:

  my $client = Net::Twitter-new(
  traits = ['OAuth', 'API::REST'],
  consumer_key = $ckey,
  consumer_secret = $csec,
  access_token = $atok,
  access_secret = $asec,
  );

For more information, see:
http://github.com/semifor/Net-Twitter/wiki/Net::Twitter-and-the-death-of-Basic-Authentication

-Marc

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en