Advertisement
patrickc

Untitled

Jan 23rd, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. copy: function() {
  2. this.controller.stageController.setClipboard(this.tweet.stripped,true);
  3. banner('Copied tweet to clipboard.');
  4. },
  5. dataJog: function() {
  6. var Twitter = new TwitterAPI(this.user);
  7. var id = this.tweet.id_str;
  8. var request = new
  9. Mojo.Service.Request("palm://com.palm.applicationManager", {
  10. method: 'send',
  11. parameters: {
  12. id: 'com.datajog.webos',
  13. params: { data: this.twitterLink}
  14. }
  15. });
  16. banner('Sent URL to DataJog');
  17. },
  18. addToInstaPaper: function() {
  19. var url = "https://www.instapaper.com/api/add";
  20. var params = 'url=' + encodeURIComponent(this.twitterLinkIp);
  21. params += "&username=" +
  22. encodeURIComponent(this.ippUser) + "&password=" +
  23. encodeURIComponent(this.ippPass);
  24. new Ajax.Request(url, {
  25. method: 'post',
  26. parameters: params,
  27. onComplete: function() {
  28. banner('Added Tweet URL to InstaPaper');
  29. }.bind(this),
  30. onFailure: function(transport) {
  31. if (transport.responseText == 403) {
  32. banner('Incorrect Instapaper Username/Password');
  33. }
  34. else{
  35. banner('The service encountered an error. Please try again later.');
  36. }
  37. }
  38. })
  39. },
  40. addToReaditLater: function() {
  41. var url = "https://readitlaterlist.com/v2/send";
  42. var params = "new={";
  43. params += '"0":{"url":"' + encodeURIComponent(this.twitterLink)
  44. + '"}';
  45. params += "}";
  46. params += "&username=" + encodeURIComponent(this.rilUser) +
  47. "&password=" + encodeURIComponent(this.rilPass) +
  48. "&apikey=fI1g8vdip517aY2d4eT21ejk9aA8X432";
  49. new Ajax.Request(url, {
  50. method: 'post',
  51. parameters: params,
  52. onComplete: function(transport) {
  53. banner('Added URL to ReadItLater');
  54. }.bind(this),
  55. onFailure: function(transport) {
  56. banner('Failed to add. Reason: ' +
  57. transport.responseText);
  58. }
  59. });
  60. },
  61. copyUrl: function() {
  62. this.controller.stageController.setClipboard(this.twitterLink,true);
  63. banner('Copied tweet URL to clipboard.');
  64. },
  65. //Sends the current tweet via email and adds the tag "Sent via Project Macaw for webOS"
  66. email: function() {
  67. var Twitter = new TwitterAPI(this.user);
  68. this.controller.serviceRequest(
  69. "palm://com.palm.applicationManager", {
  70. method: 'open',
  71. parameters: {
  72. id: "com.palm.app.email",
  73. params: {
  74. summary: "I would like to share this tweet with you",
  75. text: "From" + " @" + this.tweet.user.screen_name + ": " + this.tweet.stripped + "<br>" + " -- Sent via Project Macaw for webOS"
  76. }
  77. }
  78. }
  79. );
  80. },
  81. //Sends the current tweet via SMS/Instant Message
  82. sms: function() {
  83. this.controller.serviceRequest('palm://com.palm.applicationManager', {
  84. method: 'launch',
  85. parameters: {
  86. id: 'com.palm.app.messaging',
  87. params: {
  88. messageText: this.tweet.stripped
  89. }
  90. },
  91. onSuccess: this.handleOKResponse,
  92. onFailure: this.handleErrResponse
  93. });
  94. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement