jQuery and Authentication

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2008
Posts: 20
Reputation: needhelp83 is an unknown quantity at this point 
Solved Threads: 0
needhelp83 needhelp83 is offline Offline
Newbie Poster

jQuery and Authentication

 
0
  #1
Jan 1st, 2009
I am trying to create a web-based Twitter app that will print out a friend's timeline, but the Twitter API asks for username/password. How do I do the username/password authentication on the server-side without asking this from the user. Does anyone know how to do this? Is there also a way to create a dynamic app that will update inside the web page whenever a new twitter update occurs?

Here is the code:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. $(document).ready(function(){ $('#response').createAppend('img', { src: 'images/twitter-32x32.png', alt: 'Loading...', id: 'loading_image'}, null);
  2. $.getJSON(url, ws_results);
  3. });
  4. function ws_results(obj) {
  5. // hide the loading image
  6. $('#loading_image').hide("slow");
  7. // alternative way of displaying properties
  8. // var property, propCollection = "";
  9. // for (property in obj[0].user) {
  10. // propCollection += property + "\n";
  11. // }
  12. // alert(propCollection);
  13. $('#response').createAppend(
  14. 'table', { width: '600px', align:'center', border:'2', rules:'none', frame:'box', style: 'background:#FFF;' , Name: 'tableData', id: 'Tweets' }, [
  15. 'tr', { }, [
  16. 'th', { colspan: '2', align: 'left', style: 'background: #FFF; color: #000 ' }, [ 'img', { src: 'images/twitter-logo.jpg', align: 'left'} ]
  17. ]
  18. ]
  19. );
  20. // loop through items
  21. for (var i = 0; i < obj.length; i++) {
  22. // create table row
  23. $('#Tweets').append('<tr id="row' + i + '"><\/tr>');
  24. $('#row' + i).append('<td align="left" id="lcell' + i + '" style="font-size: 10pt;"><\/td>');
  25. $('#row' + i).append('<td align="left" id="rcell' + i + '" style="font-size: 10pt;"><\/td>');
  26. if (typeof(obj[i].user.url) == "undefined" || obj[i].user.url == '')
  27. {
  28. $('#lcell' + i).createAppend('img', { src: obj[i].user.profile_image_url, Name: 'ProfileImg', align: 'left', hspace: '5', alt: obj[i].user.name }, null);
  29. }
  30. else
  31. {
  32. $('#lcell' + i).createAppend('a', { href: obj[i].user.url }, [ 'img', { src: obj[i].user.profile_image_url, Name: 'ProfileImg', align: 'left', hspace: '5', alt: obj[i].user.name }, null]);
  33. }
  34. $('#rcell' + i).createAppend('a', { id: 'Twit', title: obj[i].user.name, href: 'http://twitter.com/' + obj[i].user.screen_name }, obj[i].user.screen_name );
  35. $('#rcell' + i).append(' ' + obj[i].text + ' ');
  36. $('#rcell' + i).append('<span id="created_at">' + obj[i].created_at + '<\/span>');
  37. $('#rcell' + i).append(' from ' + obj[i].source);
  38. }
  39. }
  40.  
  41. //]]>
  42. </script>
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 20
Reputation: needhelp83 is an unknown quantity at this point 
Solved Threads: 0
needhelp83 needhelp83 is offline Offline
Newbie Poster

Re: jQuery and Authentication

 
0
  #2
Jan 2nd, 2009
Any ideas
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: jQuery and Authentication

 
0
  #3
Jan 3rd, 2009
I don't want to ignore you but I don't know the answer either.
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC