[twitter-dev] friend exist function not working!!!!

2009-06-09 Thread grand_unifier

this has been bothering me for quite some tym now...i have written a
code which inputs two usernames(twitter id) n will o/p if both are
friends or not...
the api doc for thsi response is here...

http://apiwiki.twitter.com/Twitter-REST-API-Method:-friendships-exists

!-- this is the javascript json parser function --

script type=text/javascript src=../jquery-1.2.6.min.js
/script

script type=text/javascript

$(document).ready(function()
 {
$('form#search').bind(submit, function(e)
{
e.preventDefault();
$('#content').html('');

var query1 = urlencode($('input[name=user_a]').val
()); //userA
var query2 = urlencode($('input
[name=user_b]').val()); //userB

$.ajax( {
   url: 'http://twitter.com/
friendships/exists.json?user_a='+
query1 + 
'user_b=' + query2,
   dataType: jsonp,
   success: function(data)
   {
if(data ==
true)
{
var
newDiv = 'ptrue/p';
}

$('#content').append(newDiv);
   }

   });


});
})

  function urlencode(str) {
return escape(str).replace(/\+/g,'%2B').replace(/%20/g,
'+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
  }
})

/script

!-- javascript ends here --

the json returns true or falsebut still it doesnt seem to work
can anyone refine the code???



[twitter-dev] Re: How does the trends method in search API work?

2009-06-08 Thread grand_unifier

wat do u wanna know...

the json response wil give u the latest 10 trends n the timing
format u can parse it using jquery...the api doc explains it
well...wat api r u working on???


On Jun 8, 10:18 am, zvn zvn750...@gmail.com wrote:
 Hi,

 I'm a master student in Taiwan. I want to do some work to improve the
 trends API inhttp://apiwiki.twitter.com/Twitter-Search-API-Method%3A-trends.
 But I didn't know how does this api work, so it's hard for me to make
 a comparison between my method and the API, would any doby please tell
 me how to solve the problem?


[twitter-dev] Re: json parsing code not workin..urgent plzzz!!!!!

2009-06-08 Thread grand_unifier

$.ajax('http://twitter.com/friendships/exists.json?
user_a='+query1+'user_b='+query2,
function(data,textdata)
{
var public_tweets = JSON.parse(data);

  if(public_tweets.text == 'true')
{
  var newDiv = 'ptrue/p';
}

 $('#content').append(newDiv);

});
},text);

even this doesnt seem to work...

On Jun 6, 12:33 pm, grand_unifier jijodasgu...@gmail.com wrote:
 !-- this is the javascript json parser function --

     script type=text/javascript src=../jquery-1.2.6.min.js
     /script

     script type=text/javascript
     $(document).ready(function(){
                 $('form#search').bind(submit, function(e){
                         e.preventDefault();
                         $('#content').html('');

                         var query1 = urlencode($('input[name=user_a]').val
 ()); //userA
                         var query2 = urlencode($('input
 [name=user_b]').val()); //userB
                         var rpp = 20; //number of tweets to retrieve out

                         $.getJSON('http://twitter.com/friendships/exists.json?
 user_a='+query1+'user_b='+query2, function(data){
                              if(data == 'true'){
                              var newDiv = 'ptrue/p';}
                              $('#content').append(newDiv);
                            });
                         });
                 })

           function urlencode(str) {
             return escape(str).replace(/\+/g,'%2B').replace(/%20/g,
 '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
           }
     })

     /script

 !-- javascript ends here --

 this is a very basic code to check if two twitter users are friends or
 not the json will return true or false in'it but it does seem
 to work...its frustratin.
 anyone got any idea why???


[twitter-dev] json parsing problem...urgent

2009-06-08 Thread grand_unifier

!-- this is the javascript json parser function --

script type=text/javascript src=../jquery-1.2.6.min.js
/script

script type=text/javascript

$(document).ready(function()
 {
$('form#search').bind(submit, function(e)
{
e.preventDefault();
$('#content').html('');

var query1 = urlencode($('input[name=user_a]').val
()); //userA
var query2 = urlencode($('input
[name=user_b]').val()); //userB


$.ajax('http://twitter.com/friendships/exists.json?
user_a='+query1+'user_b='+query2,
function(data,textdata)
{


  if(data == 'false')
{
  var newDiv = 'ptrue/p';
}

 $('#content').append(newDiv);

}, 'text');
});
})

  function urlencode(str) {
return escape(str).replace(/\+/g,'%2B').replace(/%20/g,
'+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
  }
})

/script

!-- javascript ends here --

doesnt seem to workany thoughts


[twitter-dev] json parsing code not workin..urgent plzzz!!!!!

2009-06-06 Thread grand_unifier

!-- this is the javascript json parser function --

script type=text/javascript src=../jquery-1.2.6.min.js
/script

script type=text/javascript
$(document).ready(function(){
$('form#search').bind(submit, function(e){
e.preventDefault();
$('#content').html('');

var query1 = urlencode($('input[name=user_a]').val
()); //userA
var query2 = urlencode($('input
[name=user_b]').val()); //userB
var rpp = 20; //number of tweets to retrieve out

$.getJSON('http://twitter.com/friendships/exists.json?
user_a='+query1+'user_b='+query2, function(data){
 if(data == 'true'){
 var newDiv = 'ptrue/p';}
 $('#content').append(newDiv);
   });
});
})

  function urlencode(str) {
return escape(str).replace(/\+/g,'%2B').replace(/%20/g,
'+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
  }
})

/script

!-- javascript ends here --


this is a very basic code to check if two twitter users are friends or
not the json will return true or false in'it but it does seem
to work...its frustratin.
anyone got any idea why???


[twitter-dev] urls in tweets

2009-05-31 Thread grand_unifier

i have written a code to get all tweets that have urls in them in atom
or json format.

now i want a way to:

1separate the urls from the tweetslike a tweetmeme way...
2find out if the url represents a video...

how will i do that??

pls advice...