DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   jQuery and Authentication (http://www.daniweb.com/forums/thread165524.html)

needhelp83 Jan 1st, 2009 7:18 pm
jQuery and Authentication
 
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:

$(document).ready(function(){      $('#response').createAppend('img', { src: 'images/twitter-32x32.png', alt: 'Loading...', id: 'loading_image'}, null);      
      $.getJSON(url, ws_results);   
      });
      function ws_results(obj) {
      // hide the loading image
      $('#loading_image').hide("slow");
      // alternative way of displaying properties
      //    var property, propCollection = ""; 
      //    for (property in obj[0].user) { 
      //    propCollection += property + "\n";     
      //    }     
      //    alert(propCollection);
      $('#response').createAppend(     
            'table', { width: '600px', align:'center', border:'2', rules:'none', frame:'box', style: 'background:#FFF;' , Name: 'tableData', id: 'Tweets' }, [     
                'tr', {  }, [     
                    'th', { colspan: '2', align: 'left', style: 'background: #FFF; color: #000 ' }, [ 'img', { src: 'images/twitter-logo.jpg', align: 'left'} ] 
                            ]                                 
            ]     
      );   
      // loop through items 
      for (var i = 0; i < obj.length; i++) { 
      // create table row 
      $('#Tweets').append('<tr id="row' + i + '"><\/tr>');   
          $('#row' + i).append('<td align="left" id="lcell' + i + '" style="font-size: 10pt;"><\/td>'); 
          $('#row' + i).append('<td align="left" id="rcell' + i + '" style="font-size: 10pt;"><\/td>'); 
              if (typeof(obj[i].user.url) == "undefined" || obj[i].user.url == '')     
          {     
              $('#lcell' + i).createAppend('img', { src: obj[i].user.profile_image_url, Name: 'ProfileImg', align: 'left', hspace: '5', alt: obj[i].user.name }, null);
          }     
          else   
          {     
              $('#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]);       
          }     
          $('#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 );
          $('#rcell' + i).append(' ' + obj[i].text + ' ');   
          $('#rcell' + i).append('<span id="created_at">' + obj[i].created_at + '<\/span>'); 
          $('#rcell' + i).append(' from ' + obj[i].source);
      }
      }
 
      //]]>
      </script>

needhelp83 Jan 2nd, 2009 5:01 pm
Re: jQuery and Authentication
 
Any ideas

kanaku Jan 3rd, 2009 9:26 am
Re: jQuery and Authentication
 
I don't want to ignore you but I don't know the answer either. :|


All times are GMT -4. The time now is 5:26 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC