Guest User

Untitled

a guest
Jul 10th, 2012
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <html>
  2. <head>
  3. <!--
  4. Copyright (C) 2012 Twitter, Inc.
  5.  
  6. Licensed under the Apache License, Version 2.0 (the "License");
  7. you may not use this file except in compliance with the License.
  8. You may obtain a copy of the License at
  9.  
  10. http://www.apache.org/licenses/LICENSE-2.0
  11.  
  12. Unless required by applicable law or agreed to in writing, software
  13. Distributed under the License is distributed on an "AS IS" BASIS,
  14. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. See the License for the specific language governing permissions and
  16. limitations under the License.
  17. -->
  18. <script charset="utf-8" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
  19. </head>
  20. </html>
  21. <body>
  22. <table>
  23. <tr><td>
  24. <textarea id="in" cols="50" rows="30">yusukey
  25. yusuke</textarea></td><td><input type="button" onclick="fire()" value="lookup"/></td><td>
  26. <textarea id="out" cols="50" rows="30"></textarea>
  27. </td>
  28. </table>
  29. <script>
  30. function fire(){
  31. var users = $("#in").val().split("\n").join(",");
  32. $.getJSON("https://api.twitter.com/1/users/lookup.json?screen_name="+users+"&callback=?",
  33. function(data){
  34. var out = "";
  35. $.each(data, function(i,user){
  36. out+= "@"+user.screen_name + "," + user.followers_count+"\n";
  37. });
  38. $("#out").val(out);
  39. });
  40. }
  41. </script>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment