[twitter-dev] Re: trends available in Malaysia?

2011-03-27 Thread Jimmy Au
Where can i know the 43 locations. Which not include in malaysia.

On Mar 22, 8:47 am, Matt Harris  wrote:
> Hey Jimmy,
>
> You can find a list of the available trends locations by calling the API
> method trends/available. More information on this method can be found on our
> developer resources site:
>    http://dev.twitter.com/doc/get/trends/available
>
> Best,
> @themattharris
> Developer Advocate, Twitterhttp://twitter.com/themattharris
>
> On Mon, Mar 21, 2011 at 4:09 AM, twitter dev wrote:
>
>
>
>
>
>
>
> > Twitter supports topics trending only for 41 locations.
>
> > list of locations available @
> >http://apiwiki.twitter.com/w/page/22554752/Twitter-REST-API-Method:-t...
>
> > On Sun, Mar 13, 2011 at 9:45 PM, Jimmy Au  wrote:
>
> >> The following lat long is in Malaysia but the return result is not in
> >> malaysia. I am wondering this service available in malaysia?
>
> >>http://api.twitter.com/1/trends/available.json?lat=3.144491&long=101
>
> >> --
> >> 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 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 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] Question about storing username & password like tweetdeck

2011-03-27 Thread Scott Wilcox
Tweetdeck uses XAuth to obtain tokens for OAuth use.

On 27 Mar 2011, at 15:56, Jimmy Au wrote:

> I am wondering what api is using by tweetdeck which is not using oauth
> authentication. It direct using username and password for it's app.

-- 
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] Question about storing username & password like tweetdeck

2011-03-27 Thread Jimmy Au
I am wondering what api is using by tweetdeck which is not using oauth
authentication. It direct using username and password for it's app.

-- 
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] Re: Hello with OAuth connection

2011-03-27 Thread Jon
Can someone please help with the above code?

Thanks,

Jon

On Mar 25, 3:57 pm, Jon  wrote:
> Thanks... I should've posted the whole thing because now I'm getting
> another error! This is what I'm trying to do (I really appreciate your
> help!):
>
>             /* Load required lib files. */
>      require_once('twitteroauth/twitteroauth.php'); /* This is the
> library for connecting with oAuth */
>      require_once('config.php'); /* This is the file that contains
> the oAuth credentials - this will be different for each app */
>     //$twitterUser = 'YOUR_FRIENDS_USERNAME';
>     $twitterUser = $field_twitter_url;
>      /* Create a TwitterOauth object with consumer/user tokens. */
>      $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> OAUTH_TOKEN, OAUTH_TOKEN_SECRET);
>      $statuses = $connection->get('statuses/user_timeline',
> array('screen_name' => $twitterUser'));
>
>      //create a time display like '1 hour ago'
>      function twitterTime($time) {
>            $delta = time() - $time;
>            if ($delta < 60) {
>               return 'less than a minute ago.';
>            } else if ($delta < 120) {
>              return 'about a minute ago.';
>            } else if ($delta < (45 * 60)) {
>              return floor($delta / 60) . ' minutes ago.';
>            } else if ($delta < (90 * 60)) {
>              return 'about an hour ago.';
>            } else if ($delta < (24 * 60 * 60)) {
>              return 'about ' . floor($delta / 3600) . ' hours ago.';
>            } else if ($delta < (48 * 60 * 60)) {
>              return '1 day ago.';
>            } else {
>              return floor($delta / 86400) . ' days ago.';
>            }
>      }
>      //this is an empty string container we're going to pass the
> result of our loop into
>      $twitterString = "";
>
>                       foreach ($xml->status as $entry)
>                       {
>
>  // there are more elements to choose from 
> see:http://apiwiki.twitter.com/REST+API+Documentation#Statuselement
>                   $status               = $entry->text;
>                   $profilePic   = $entry->user->profile_image_url;
>                   $profileName  = $entry->user->screen_name;
>                   $statusRealName       = $entry->user->name;
>                   $profileURL   = $entry->user->url;
>                   $statusDate   = $entry->created_at;
>                   $statusSource         = $entry->source;
>                   $statusDateFormatted = twitterTime(strtotime($statusDate));
>                   $profileBio   = $entry->user->description;
>                   $statusFollowCount    = $entry->user->followers_count;
>
>                   echo "\n";
>                   echo "\n";
>                   echo "\n";
>                   echo "http://www.twitter.com/$profileName\"; 
> target=
> \"_blank\"> \"$profileRealName\" />\n";
>                   echo "\n";
>                   echo "\n";
>                   echo "\n";
>                   echo "\n";
>                   echo " href=\"http://www.twitter.com/
> $profileName\" target=\"_blank\">$profileName\n";
>                   echo "\n";
>                   echo " 
> $statusRealName span>\n";
>                   echo "\n";
>                   echo "$status\n";
>                   echo "\n";
>                   echo "$statusDateFormatted from 
> $statusSource\n";
>                   echo "\n";
>                   echo "\n";
>                   echo "\n";
>                   echo "\n";
>                   echo "\n";
>
>                       }
>                  ?>
>
> On Mar 25, 3:52 pm, Abraham Williams <4bra...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Oops. I had a type. The = needs a > directly after it like =>
>
> > Abraham
> > -
> > Abraham Williams | Hacker Advocate | abrah.am
> > Just launched from Answerly :
> > InboxQfor Chrome
> > @abraham  | github.com/abraham | blog.abrah.am
> > This email is: [ ] shareable [x] ask first [ ] private.
>
> > On Fri, Mar 25, 2011 at 15:44, Jon  wrote:
> > > Thanks Abraham,
>
> > > I'm getting an error on the last line there though:
>
> > > "Parse error: syntax error, unexpected '=', expecting ')' in ..."
>
> > > On Mar 25, 3:33 pm, Abraham Williams <4bra...@gmail.com> wrote:
> > > > You are not formatting the GET request correctly and TwitterOAuth
> > > > automatically parses the JSON response for you.
>
> > > >  > > >      /* Load required lib files. */
> > > >      require_once('twitteroauth/twitteroauth.php'); /* This is the
> > > > library for connecting with oAuth */
> > > >      require_once('config.php'); /* This is the file that contains
> > > > the oAuth credentials - this will be different for each app */
>
> > > >     //$twitterUser = 'YOUR_FRIENDS_USERNAME';
> > > >     $twitterUser = $field_twitter_url;
>
> > > >      /* Create a TwitterOauth object with consumer/user tokens. */
> > > >      $connection =

[twitter-dev] Re: Hello with OAuth connection

2011-03-27 Thread Blaaze
what exactly you want to implement, am a freelancer and you can hire
me at good rates.

-- 
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] Re: Hello with OAuth connection

2011-03-27 Thread Jon
All I'm trying to do is pull the user timeline or latest tweets for a
given user that I follow. I think I have the code 99% correct, but I
am horrible with PHP and am getting an error: Parse error: syntax
error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'

Can someone please let me know where my error may be?

Thanks,

Jon

On Mar 27, 9:12 am, Blaaze  wrote:
> what exactly you want to implement, am a freelancer and you can hire
> me at good rates.

-- 
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] Re: Hello with OAuth connection

2011-03-27 Thread Blaaze Artifex
can you post the exact code and exact error that you are seeing on your
browser

On Sun, Mar 27, 2011 at 11:38 PM, Jon  wrote:

> All I'm trying to do is pull the user timeline or latest tweets for a
> given user that I follow. I think I have the code 99% correct, but I
> am horrible with PHP and am getting an error: Parse error: syntax
> error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'
>
> Can someone please let me know where my error may be?
>
> Thanks,
>
> Jon
>
> On Mar 27, 9:12 am, Blaaze  wrote:
> > what exactly you want to implement, am a freelancer and you can hire
> > me at good rates.
>
> --
> 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 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] Twitter share button without count

2011-03-27 Thread Arnaud Meunier
Hey,

Simply set the data-count property to "none". For more information, read the
doc: http://dev.twitter.com/pages/tweet_button#position-count

Arnaud / @rno 



On Fri, Mar 25, 2011 at 9:03 AM, twitter dev wrote:

> HI Guys,
>
> I'm using the following code for Twitter share button with count,
>
> http://twitter.com/share"; class="twitter-share-button" data-url="
> http://sample.com"; data-text="Sample message!" data-count="horizontal"
> data-via="" data-related="">Tweet
> http://platform.twitter.com/widgets.js
> ">
>
> Now, I would like to hide the count and have only button. Can anyone please
> suggest or point me to the code ?
>
> I tried removed data-count, which dint fixed the problem.
>
> I did not find this on Twitter doc's.
>
>
> Thanks In Advance,
> -dev.
>
> --
> 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 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] Twitter Basics and Errors

2011-03-27 Thread Arnaud Meunier
Hey Chris,

1) Is the IP you're using shared? For example, what was the value of
"X-RateLimit-Remaining" _before_ starting the test? If you're concerned with
Rate Limiting, you should really consider authenticating your calls.

2) Looks like you're not using your library correctly for search. Try:
$search = $twitterObj->get_search(array('q' => 'whatever'));

Arnaud / @rno



On Fri, Mar 25, 2011 at 12:24 PM, Chris S.  wrote:

> I am in the process of getting re-acquainted with the API after a lot
> of changes and I have run into some issues.
>
> I am getting rate limited when I do a call to get the follower IDs. As
> I understand it, it has 150 uses on my IP per hour, but I couldn't
> have made more than 4 calls. My script is fairly simple as a test:
>
> $twitterObj = new EpiTwitter();
> $followers = $twitterObj->get_followersIds( array ('screen_name' =>
> 'whoever'));
> print "\n" . count($followers);
>
> This isn't a part of a loop or anything, but I get a Rate Limit
> Exceeded error after only one or 2 calls to this. Any idea what could
> be wrong?
>
> Also, has something changed with search? I attempt to do:
>
> $twitterObj = new EpiTwitter();
> $search = $twitterObj->search('whatever');
> echo $search->responseText;
>
> And I get a 403 Forbidden error.
>
> Both my examples are using the php wrapper found here:
> http://www.jaisenmathai.com/articles/twitter-php-oauth.html
>
> If anyone has any help with my I might be seeing these errors, or if
> there is a better library for PHP to do basic no authentication tasks,
> such as getting a users followers and doing basic search queries, I
> would very much appreciate it.
>
> Thank you.
>
> --
> 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 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] Re: Hello with OAuth connection

2011-03-27 Thread Jon
The exact code is posted above... you can see the error here:
http://realestateagentswhotweet.com/kristan-cole/

I think it's something structurally though with the PHP, as line 65
itself should be fine, it's just the standard time display code below:

 //create a time display like '1 hour ago'
 function twitterTime($time) {
   $delta = time() - $time;
   if ($delta < 60) {
  return 'less than a minute ago.';
   } else if ($delta < 120) {
 return 'about a minute ago.';
   } else if ($delta < (45 * 60)) {
 return floor($delta / 60) . ' minutes ago.';
   } else if ($delta < (90 * 60)) {
 return 'about an hour ago.';
   } else if ($delta < (24 * 60 * 60)) {
 return 'about ' . floor($delta / 3600) . ' hours ago.';
   } else if ($delta < (48 * 60 * 60)) {
 return '1 day ago.';
   } else {
 return floor($delta / 86400) . ' days ago.';
   }
 }


I don't think the error is from the above, it's something structurally
above or below this code. Am I missing some brackets or something
somewhere? I'm not good enough with PHP to be able to tell.

Thanks,

Jon
On Mar 27, 10:14 am, Blaaze Artifex  wrote:
> can you post the exact code and exact error that you are seeing on your
> browser
>
>
>
>
>
>
>
> On Sun, Mar 27, 2011 at 11:38 PM, Jon  wrote:
> > All I'm trying to do is pull the user timeline or latest tweets for a
> > given user that I follow. I think I have the code 99% correct, but I
> > am horrible with PHP and am getting an error: Parse error: syntax
> > error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'
>
> > Can someone please let me know where my error may be?
>
> > Thanks,
>
> > Jon
>
> > On Mar 27, 9:12 am, Blaaze  wrote:
> > > what exactly you want to implement, am a freelancer and you can hire
> > > me at good rates.
>
> > --
> > 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 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] Re: Hello with OAuth connection

2011-03-27 Thread Blaaze
in this code above especially in your function twitterTime

please remove single quotes and replace them with double quotes and
also remove that first line of comment, then try it will work

-- 
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] Re: Hello with OAuth connection

2011-03-27 Thread Jon
Thanks Blaze... I think we're getting closer, now the error is on like
78 (You can see it here: http://realestateagentswhotweet.com/kristan-cole/)

Here is the code:



';
bcn_display();
echo '';
}
?>





AGENT PROFILE




The profile of  
real estate agent .




  http://www.twitter.com/" target="_blank">




Areas Served:', ',', ''); ?>






AGENT TWEETS



The latest tweets from . 

  get("statuses/user_timeline",
array("screen_name" => $twitterUser));

 function twitterTime($time) {
   $delta = time() - $time;
   if ($delta < 60) {
  return "less than a minute ago.";
   } else if ($delta < 120) {
 return "about a minute ago.";
   } else if ($delta < (45 * 60)) {
 return floor($delta / 60) . " minutes ago.";
   } else if ($delta < (90 * 60)) {
 return "about an hour ago.";
   } else if ($delta < (24 * 60 * 60)) {
 return "about " . floor($delta / 3600) . " hours ago.";
   } else if ($delta < (48 * 60 * 60)) {
 return "1 day ago.";
   } else {
 return floor($delta / 86400) . " days ago.";
   }
 }

 $twitterString = "";

  foreach ($xml->status as $entry)
  {


  $status   = $entry->text;
  $profilePic   = $entry->user->profile_image_url;
  $profileName  = $entry->user->screen_name;
  $statusRealName   = $entry->user->name;
  $profileURL   = $entry->user->url;
  $statusDate   = $entry->created_at;
  $statusSource = $entry->source;
  $statusDateFormatted = twitterTime(strtotime($statusDate));
  $profileBio   = $entry->user->description;
  $statusFollowCount= $entry->user->followers_count;

  echo "\n";
  echo "\n";
  echo "\n";
  echo "http://www.twitter.com/$profileName\"; target=
\"_blank\">\n";
  echo "\n";
  echo "\n";
  echo "\n";
  echo "\n";
  echo "http://www.twitter.com/
$profileName\" target=\"_blank\">$profileName\n";
  echo "\n";
  echo " 
$statusRealName\n";
  echo "\n";
  echo "$status\n";
  echo "\n";
  echo "$statusDateFormatted from $statusSource\n";
  echo "\n";
  echo "\n";
  echo "\n";
  echo "\n";
  echo "\n";


  }
 ?>


It says the error is on line 78, which is:

foreach ($xml->status as $entry)

The error is:

Warning: Invalid argument supplied for foreach() in ... on line 78

Thanks,

Jon



On Mar 27, 1:44 pm, Blaaze  wrote:
> in this code above especially in your function twitterTime
>
> please remove single quotes and replace them with double quotes and
> also remove that first line of comment, then try it will work

-- 
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] Perl devs: new AutoCursor trait for Net::Twitter

2011-03-27 Thread Marc Mims
If you're using Net::Twitter's friends_ids or follower_ids methods 
without a cursor parameter, an upcoming Twitter API change will break 
your code.

I've added an AutoCursor trait (currently in a developer only release), 
to deal as transparently as possible with the change.

I blogged about it here: http://post.ly/1oKFG

After I get some feedback, I'll make any necessary interface changes and 
make a production release.

-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


Re: [twitter-dev] Perl devs: new AutoCursor trait for Net::Twitter

2011-03-27 Thread M. Edward (Ed) Borasky
On Sun, 27 Mar 2011 16:14:10 -0700, Marc Mims  
wrote:

If you're using Net::Twitter's friends_ids or follower_ids methods
without a cursor parameter, an upcoming Twitter API change will break
your code.

I've added an AutoCursor trait (currently in a developer only 
release),

to deal as transparently as possible with the change.

I blogged about it here: http://post.ly/1oKFG

After I get some feedback, I'll make any necessary interface changes 
and

make a production release.

-Marc


I've had explicit cursor / page logic in all my Net::Twitter calls 
since I started using it - is there any reason to switch to AutoCursor?

--
http://twitter.com/znmeb http://borasky-research.net

"A mathematician is a device for turning coffee into theorems." -- Paul 
Erdős


--
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] Re: Perl devs: new AutoCursor trait for Net::Twitter

2011-03-27 Thread Marc Mims
On Mar 27, 4:30 pm, "M. Edward (Ed) Borasky"  wrote:
>  I've had explicit cursor / page logic in all my Net::Twitter calls
>  since I started using it - is there any reason to switch to AutoCursor?

Probably not. If you're using cursors in the same way AutoCursor does,
then using AutoCursor would make your application code a bit cleaner.
Feel free to have a look at the source code.

AutoCursor is what I will point people to when Twitter throws the
switch and I start getting "OMG! The sky is falling!" emails. :)

-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


Re: [twitter-dev] Re: Hello with OAuth connection

2011-03-27 Thread Abraham Williams
The variable name $xml was changed to $statuses further up and you didn't
change the later $xml to $statuses.

Abraham
-
Abraham Williams | Hacker Advocate | abrah.am
 Just launched from Answerly :
InboxQfor Chrome
@abraham  | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.



On Sun, Mar 27, 2011 at 15:15, Jon  wrote:

> Thanks Blaze... I think we're getting closer, now the error is on like
> 78 (You can see it here: http://realestateagentswhotweet.com/kristan-cole/
> )
>
> Here is the code:
>
> 
>
>if(function_exists('bcn_display'))
>{
>echo '';
>bcn_display();
>echo '';
>}
>?>
>
>
>
>
>
>AGENT PROFILE
>
>
>//init custom fields
>$pid = get_the_ID();
>$field_about= get_post_meta($pid, field_about, true);
>?>
>
>The profile of  ?> real estate agent  php the_title(); ?>.
>
>
>
>
> class="fn">  span> http://www.twitter.com/ echo get_the_content(); ?>" target="_blank"> get_the_content(); ?>
>
>
> $field_about; ?>
>
> class="tags">Areas Served: span>', ',', ''); ?>
>
>
>
>
>
>
>AGENT TWEETS
>
>
>
>The latest tweets from .
> 
>
>  
> require_once("twitteroauth/twitteroauth.php");
> require_once("config.php");
> $twitterUser = get_the_content();
>
> $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> OAUTH_TOKEN, OAUTH_TOKEN_SECRET);
> $statuses = $connection->get("statuses/user_timeline",
> array("screen_name" => $twitterUser));
>
> function twitterTime($time) {
>   $delta = time() - $time;
>   if ($delta < 60) {
>  return "less than a minute ago.";
>   } else if ($delta < 120) {
> return "about a minute ago.";
>   } else if ($delta < (45 * 60)) {
> return floor($delta / 60) . " minutes ago.";
>   } else if ($delta < (90 * 60)) {
> return "about an hour ago.";
>   } else if ($delta < (24 * 60 * 60)) {
> return "about " . floor($delta / 3600) . " hours ago.";
>   } else if ($delta < (48 * 60 * 60)) {
> return "1 day ago.";
>   } else {
>  return floor($delta / 86400) . " days ago.";
>}
> }
>
> $twitterString = "";
>
>  foreach ($xml->status as $entry)
>  {
>
>
>   $status   = $entry->text;
>  $profilePic   = $entry->user->profile_image_url;
>  $profileName  = $entry->user->screen_name;
>  $statusRealName   = $entry->user->name;
>  $profileURL   = $entry->user->url;
>  $statusDate   = $entry->created_at;
>  $statusSource = $entry->source;
>  $statusDateFormatted =
> twitterTime(strtotime($statusDate));
>  $profileBio   = $entry->user->description;
>  $statusFollowCount= $entry->user->followers_count;
>
>  echo "\n";
>  echo "\n";
>  echo "\n";
>  echo "http://www.twitter.com/$profileName\";
> target=
> \"_blank\"> \"$profileRealName\" />\n";
>  echo "\n";
>  echo "\n";
>  echo "\n";
>  echo "\n";
>  echo " http://www.twitter.com/
> $profileName\" target=\"_blank\">$profileName\n";
>  echo "\n";
>  echo "
> $statusRealName span>\n";
>  echo "\n";
>  echo "$status\n";
>  echo "\n";
>  echo "$statusDateFormatted from
> $statusSource\n";
>  echo "\n";
>  echo "\n";
>  echo "\n";
>  echo "\n";
>  echo "\n";
>
>
>  }
> ?>
>
>
> It says the e

[twitter-dev] Re: Hello with OAuth connection

2011-03-27 Thread Jon
Thanks Abraham, I changed it to $satuses, but will get the same error
on that line: Warning: Invalid argument supplied for foreach() in ...
on line 78

On Mar 27, 5:36 pm, Abraham Williams <4bra...@gmail.com> wrote:
> The variable name $xml was changed to $statuses further up and you didn't
> change the later $xml to $statuses.
>
> Abraham
> -
> Abraham Williams | Hacker Advocate | abrah.am
>  Just launched from Answerly :
> InboxQfor Chrome
> @abraham  | github.com/abraham | blog.abrah.am
> This email is: [ ] shareable [x] ask first [ ] private.
>
>
>
>
>
>
>
> On Sun, Mar 27, 2011 at 15:15, Jon  wrote:
> > Thanks Blaze... I think we're getting closer, now the error is on like
> > 78 (You can see it here:http://realestateagentswhotweet.com/kristan-cole/
> > )
>
> > Here is the code:
>
> > 
> >        
> >                 >                if(function_exists('bcn_display'))
> >                {
> >                        echo '';
> >                        bcn_display();
> >                        echo '';
> >                }
> >                ?>
> >                
> >                
> >                
> >                
> >                        
> >                                AGENT PROFILE
> >                        
> >                
> >                 >                //init custom fields
> >                $pid = get_the_ID();
> >                $field_about    = get_post_meta($pid, field_about, true);
> >                ?>
> >                        
> >                                The profile of  > ?> real estate agent  > php the_title(); ?>.
> >                        
> >                        
> >                                
> >                                        
> >                                                 > class="fn">  > span> http://www.twitter.com/ > echo get_the_content(); ?>" target="_blank"> > get_the_content(); ?>
> >                                        
> >                                        
> >                                         > $field_about; ?>
> >                                        
> >                                         > class="tags">Areas Served: > span>', ',', ''); ?>
> >                                
> >                        
> >                
> >                
> >                
> >                        
> >                                AGENT TWEETS
> >                        
> >                
> >                
> >                        The latest tweets from .
> > 
> >                
> >      
> >     require_once("twitteroauth/twitteroauth.php");
> >     require_once("config.php");
> >     $twitterUser = get_the_content();
>
> >     $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> > OAUTH_TOKEN, OAUTH_TOKEN_SECRET);
> >     $statuses = $connection->get("statuses/user_timeline",
> > array("screen_name" => $twitterUser));
>
> >     function twitterTime($time) {
> >           $delta = time() - $time;
> >           if ($delta < 60) {
> >              return "less than a minute ago.";
> >           } else if ($delta < 120) {
> >             return "about a minute ago.";
> >           } else if ($delta < (45 * 60)) {
> >             return floor($delta / 60) . " minutes ago.";
> >           } else if ($delta < (90 * 60)) {
> >             return "about an hour ago.";
> >           } else if ($delta < (24 * 60 * 60)) {
> >             return "about " . floor($delta / 3600) . " hours ago.";
> >           } else if ($delta < (48 * 60 * 60)) {
> >             return "1 day ago.";
> >           } else {
> >              return floor($delta / 86400) . " days ago.";
> >            }
> >     }
>
> >     $twitterString = "";
>
> >                      foreach ($xml->status as $entry)
> >                      {
>
> >                   $status               = $entry->text;
> >                  $profilePic   = $entry->user->profile_image_url;
> >                  $profileName  = $entry->user->screen_name;
> >                  $statusRealName       = $entry->user->name;
> >                  $profileURL   = $entry->user->url;
> >                  $statusDate   = $entry->created_at;
> >                  $statusSource         = $entry->source;
> >                  $statusDateFormatted =
> > twitterTime(strtotime($statusDate));
> >                  $profileBio   = $entry->user->description;
> >                  $statusFollowCount    = $entry->user->followers_count;
>
> >                  echo "\n";
> >                  echo "\n";
> >                  echo "\n";
> >                  echo "http://www.twitter.com/$profileName\";
> > target=
> > \"_blank\"> > \"$profileRealName\" />\n";
> >                  echo "\n";
> >                  echo "\n";
> >                  echo "\n";
> >                  echo "\n";
> >                  echo " >http://www.twitter.com/
> > $profileName\" target=\"_blank\">$profileName\n"

[twitter-dev] Re: Data-expanded-url attribute

2011-03-27 Thread ctrand
Thanks for the reply Matt,

I am using data-counturl for tweets made using the tweet button, and
usually these seem to be fine and after 10-15 minutes will give a +1
to the counter on the tweet button.

However, for tweets I make using the API directly (using the Twitter
gem) the counter +1 seems to be far less consistent. Is there an
equivalent of data-counturl for the API?

In fact in the last week or so I have noticed that NONE of my tweets
done through the API are registering on the relevant counters where
previously they would.

I look forward to your reply,

Carl

On Feb 17, 5:38 am, Matt Harris  wrote:
> When using a shorturl you sometimes need to help the Tweet Button identify
> the correct URL to count. To do this add the full, long URL as the
> data-counturl parameter of the button. More information on this is in our
> Tweet Button documentation:
>    http://dev.twitter.com/pages/tweet_button#using-shorturl
>
> The data-expanded-url is something added during the presentation processing
> of twitter.com - it has no affect on the URL counting system or click
> destination.
>
> Ken: can you give me an example of one of the URLs which causes the 404s you
> describe.
>
> Best,
> @themattharris
> Developer Advocate, Twitterhttp://twitter.com/themattharris
>
>
>
> On Tue, Feb 15, 2011 at 8:38 PM, ctrand  wrote:
> > Does anyone have any thoughts on the issue Ken and I are looking at?
>
> > On Feb 15, 11:04 pm, "Ken D."  wrote:
> > > I have a possibly related problem.
>
> > > We also use an inhouse shortener that returns a 301 redirect, but
> > > Twitterbot misinterprets the shortened URLs. The usual search engine
> > > bots follow the redirect correctly, as far as I can tell.
>
> > > Each tweet results in a frenzy of 404s from API users who have
> > > received the incorrect URL. Mousing over the shortened URL on
> > > Twitter.com shows the incorrect URL in the title tooltip. Fortunately
> > > for now, it seems we are not subject to t.co wrapping so the original,
> > > correct short URLs can be clicked by Twitter.com users.
>
> > > The incorrectly interpreted URL is always the same. We've set it up to
> > > redirect to our home page so all is not lost.
>
> > > Any ideas what could be going on here?
>
> > > Thanks, Ken
>
> > > On Feb 14, 2:04 am, ctrand  wrote:
>
> > > > Any ideas on this one guys?
>
> > > > On Feb 10, 4:06 pm, ctrand  wrote:
>
> > > > > Hello,
>
> > > > > I have a bunch of shortened urls which are resolved/redirected to
> > full
> > > > > urls by my webapp.
>
> > > > > e.g.
>
> > > > >http://dealush.com/sale/2wml
>
> > > > > resolves to
>
> >http://dealush.com/shopping-sales/2wml/sydney-sale-8-off-at-catwalk-w...
>
> > > > > When I tweet the short URL, sometimes the data-expanded-url attribute
> > > > > is populated for the url and when I mouseover it I can see the full
> > > > > url. However sometimes it is not populated, and there is no data-
> > > > > expanded-url attribute at all!
>
> > > > > I am wondering if anyone can shed some light onto why it would be so.
>
> > > > > I am also thinking that this is affecting the counters on my tweet
> > > > > buttons, as tweets that do have an URL with the data-expanded-url
> > > > > attribute give a +1 for the counter, and those that do not have a
> > data-
> > > > > expanded-url don't.
>
> > > > > Does something need to happen for the data-expanded-url value to
> > > > > populate? Or perhaps there something wrong with some of my URLS?
>
> > > > > Note: THe example URL above does have a data-expanded-url value.
>
> > > > > Thanks in advance,
>
> > > > > Carl
>
> > > > > PS - Please let me know if you need any additional information from
> > me
> > > > > and it will be forthcoming!
>
> > --
> > 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 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] Re: Some changes and updates to the API and Tweet Button

2011-03-27 Thread Joe Mayo
Matt,

Could you clarify how [list identifier] works?  In my case, I used
(something like):

 /1/lists/update.xml?list_id=123&name=test&description=test2

and it worked.

However, other combinations of slug, name (old param), and identifiers
failed with 400/404's (depending on permutation).  Further, wouldn't /
1/lists/update only work for the authenticated user, resulting in
screen_name and user_id being redundant?  If so, would it be correct
to assume that the true meaning of [list identifier] is different for
various resources?

Thanks,

Joe

On Mar 25, 5:11 pm, Matt Harris  wrote:
> Hey everyone,
>
> We've been working on a few fixes and optimisations which are making their
> way into the API.
>
> The quick list (more information further down the email):
> * [Now] Tweet Button share flow has some UI improvements and now supports
> mobile smart phones.
> * [Now] Attempting to view a direct message which you did not send or
> receive now returns a HTTP status code of 403 instead of a 401
> * [Now] Attempting to view or destroy a direct message without providing a
> message ID now returns a 400 status code instead of a 404
> * [Now] We've added a new method /1/friendships/no_retweet_ids.{format} to
> let streaming clients know whose retweets to silence in timelines.
> * [Now] An alternative set of URLs have been created for lists to allow
> requests by user_id or screen_name.
> * [Soon] The trends endpoints on search.twitter.com are being turned off as
> they exist on api.twitter.com instead
> * [Soon] followers/ids and friends/ids is being updated to set the cursor to
> -1 if it isn't supplied during the request. This changes the default
> response format.
>
> More information:
>
> [Now] Tweet Button share flow has had some UI improvements which includes
> support for mobile smart phones.
> 
> This change is automatic and all users of the Tweet Button will already be
> receiving the new design. When a smartphone is detected, we render the
> mobile view for you - meaning you don't need to do anything to have your
> Tweet Button support mobile users.
>
> [Now] Attempting to view a direct message which you did not send/receive now
> returns 403 instead of 401
> 
> This change affects /1/direct_messages/show.{format}. If the current_user is
> not the sender or receiver of the message, we now return a 403 (instead of a
> 401) with the message "You may only view direct messages you've sent or
> received."
>
> [Now] Attempting to destroy a direct message without providing a message ID
> now returns a 400 instead of a 404
> 
> This change affects /1/direct_messages/show.{format} and
> /1/direct_messages/destroy.{format}. If the id parameter is not provided, we
> now return a 400 (instead of a 404) with the error message "Missing required
> parameter: ID."
>
> [Now] We've added a new method /1/friendships/no_retweet_ids.{format} to
> help streaming clients know whose retweets to silence in timelines.
> 
> Userstreams and Sitestreams include all retweets created by a users
> followings. The new REST API method /1/friendships/no_retweet_ids.{format}
> provides developers of Streaming applications with a comma separated list of
> user_ids for which the authenticating user has said they do not want to
> receive retweets from.
>
> [Now] An alternative set of URLs have been created for lists to allow
> requests by user_id or screen_name.
> 
> Instead of providing a users screen_name in the URL for a list, you can now
> choose to provide either their user_id or screen_name. The old routes will
> continue to operate but we encourage developers to transition to the new
> routes as soon as possible.
>
> The new routes and parameter names are:
> POST /1/lists/create -- name, mode, description
> POST /1/lists/update -- [list identifier], mode, description
> GET /1/lists -- user_id, screen_name, cursor
> GET /1/lists/show -- [list identifier]
> POST /1/lists/destroy -- [list identifier]
> GET /1/lists/statuses -- [list identifier], since_id, max_id
> GET /1/lists/memberships -- [list identifier], cursor, member_user_id,
> member_screen_name
> GET /1/lists/subscriptions -- [list identifier], cursor, subscriber_user_id,
> subscriber_screen_name
>
> GET /1/lists/members -- [list identifier], cursor
> POST /1/lists/members/create -- [list identifier], member_user_id,
> member_screen_name
> POST /1/lists/members/create_all -- [list identifier], member_user_ids,
> member_screen_names
> POST /1/lists/members/destroy -- [list identifier], member_user_id,
> member_screen_name
> GET /1/lists/members/show -- [list identifier], member_user_id,
> member_screen_name
>
> GET /1/lists/subscribers -- [list identifier], cursor
> POST /1/lists/subscribers/create -- [list identifier]
> POST /1/lists/subscribers/destroy -- [list identifier]
> GET /1/lists/subscribers/show -- [list identifier], subscriber_user_id,
> subscriber_screen_name
>
> [list identifier] represen

Re: [twitter-dev] Re: Hello with OAuth connection

2011-03-27 Thread Abraham Williams
var_dump() the $statuses var to make sure it is what you expect and change
the foreach() as appropriate.

Abraham
-
Abraham Williams | Hacker Advocate | abrah.am
 Just launched from Answerly :
InboxQfor Chrome
@abraham  | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.



On Sun, Mar 27, 2011 at 17:50, Jon  wrote:

> Thanks Abraham, I changed it to $satuses, but will get the same error
> on that line: Warning: Invalid argument supplied for foreach() in ...
> on line 78
>
> On Mar 27, 5:36 pm, Abraham Williams <4bra...@gmail.com> wrote:
> > The variable name $xml was changed to $statuses further up and you didn't
> > change the later $xml to $statuses.
> >
> > Abraham
> > -
> > Abraham Williams | Hacker Advocate | abrah.am
> >  Just launched from Answerly :
> > InboxQfor Chrome
> > @abraham  | github.com/abraham |
> blog.abrah.am
> > This email is: [ ] shareable [x] ask first [ ] private.
> >
> >
> >
> >
> >
> >
> >
> > On Sun, Mar 27, 2011 at 15:15, Jon  wrote:
> > > Thanks Blaze... I think we're getting closer, now the error is on like
> > > 78 (You can see it here:
> http://realestateagentswhotweet.com/kristan-cole/
> > > )
> >
> > > Here is the code:
> >
> > > 
> > >
> > > > >if(function_exists('bcn_display'))
> > >{
> > >echo '';
> > >bcn_display();
> > >echo '';
> > >}
> > >?>
> > >
> > >
> > >
> > >
> > >
> > >AGENT PROFILE
> > >
> > >
> > > > >//init custom fields
> > >$pid = get_the_ID();
> > >$field_about= get_post_meta($pid, field_about,
> true);
> > >?>
> > >
> > >The profile of  ');
> > > ?> real estate agent  > > php the_title(); ?>.
> > >
> > >
> > >
> > >
> > > class="name"> > > class="fn">  > > span> http://www.twitter.com/ > > echo get_the_content(); ?>" target="_blank"> > > get_the_content(); ?>
> > >
> > >
> > > echo
> > > $field_about; ?>
> > >
> > > > > class="tags">Areas Served: > > span>', ',', ''); ?>
> > >
> > >
> > >
> > >
> > >
> > >
> > >AGENT TWEETS
> > >
> > >
> > >
> > >The latest tweets from .
> > > 
> > >
> > >   >
> > > require_once("twitteroauth/twitteroauth.php");
> > > require_once("config.php");
> > > $twitterUser = get_the_content();
> >
> > > $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> > > OAUTH_TOKEN, OAUTH_TOKEN_SECRET);
> > > $statuses = $connection->get("statuses/user_timeline",
> > > array("screen_name" => $twitterUser));
> >
> > > function twitterTime($time) {
> > >   $delta = time() - $time;
> > >   if ($delta < 60) {
> > >  return "less than a minute ago.";
> > >   } else if ($delta < 120) {
> > > return "about a minute ago.";
> > >   } else if ($delta < (45 * 60)) {
> > > return floor($delta / 60) . " minutes ago.";
> > >   } else if ($delta < (90 * 60)) {
> > > return "about an hour ago.";
> > >   } else if ($delta < (24 * 60 * 60)) {
> > > return "about " . floor($delta / 3600) . " hours ago.";
> > >   } else if ($delta < (48 * 60 * 60)) {
> > > return "1 day ago.";
> > >   } else {
> > >  return floor($delta / 86400) . " days ago.";
> > >}
> > > }
> >
> > > $twitterString = "";
> >
> > >  foreach ($xml->status as $entry)
> > >  {
> >
> > >   $status   = $entry->text;
> > >  $profilePic   = $entry->user->profile_image_url;
> > >  $profileName  = $entry->user->screen_name;
> > >  $statusRealName   = $entry->user->name;
> > >  $profileURL   = $entry->user->url;
> > >  $statusDate   = $entry->created_