Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Where can I find a simple OAuth plugin I can use for my Twitter Search app?

Hi Mike, go Source-WEB_RESOURCES-files and delete mobilescreen1.js (it should be blue one, you can delete whole files folder as well).
Further on WEB_RESOURCES click options and choose Undo all source changes.

mikeflores2000
Posts: 0
Joined: Sun May 06, 2012 11:09 pm

Where can I find a simple OAuth plugin I can use for my Twitter Search app?

Undo restored broken code and app still fails in the same way.
Can't I just delete file folder then exit app?
Would file folder be auto generated upon testing?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Where can I find a simple OAuth plugin I can use for my Twitter Search app?

Hi Mike,

It would be better to restore files via Undo operation.
In file "mobilescreen1.js" line 326 there is a syntax error, please check.

mikeflores2000
Posts: 0
Joined: Sun May 06, 2012 11:09 pm

Where can I find a simple OAuth plugin I can use for my Twitter Search app?

Hi Katya,

We are going around in circles.
4 days ago I reported same error already checked.
Line 326 bits = o1 < 18 & 0x3f;
does not match
Line 21bits = o1<<< 18 & 0x3f;
throws
Uncaught SyntaxError: Unexpected number mobilescreen1.js:326

TwiiterSearchJS.js has correct code

line 21 bits = o1<<<8 | o3;

Further, I question how much QA and testing is done by Appery.io before publishing tutorials with bugs. This is not the first time.

Please advise.

Mike

mikeflores2000
Posts: 0
Joined: Sun May 06, 2012 11:09 pm

Where can I find a simple OAuth plugin I can use for my Twitter Search app?

Hi Katya,

I just confirmed this forum is corrupting my characters so I cannot post a reply.
I will email support directly.
Thanks,
Mike

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Where can I find a simple OAuth plugin I can use for my Twitter Search app?

Hi Mike,

There are a lot of mistakes in your code.

Why do you insert TwitSearchGlobal object definition as a handler for mobileslider2?

Next, you are greatly modified TwitterSearchJS and made a lot of very serious mistakes.

Here is the code which overcomes the problems of syntax with comments about them:

codeTwitSearchGlobal = {

Code: Select all

 bearerToken : "", 

     encodeBase64 : function ( data ) { 

&#47;&#47; Encodes data with MIME base64
&#47;&#47; + original by: Tyler Akins (http:&#47;&#47;rumkin&#46;com)
&#47;&#47; + improved by: Bayron Guevara

Code: Select all

        var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+&#47;=&quot 
     var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc=''; 

     do { 

&#47;&#47; pack three octets into four hexes

Code: Select all

         o1 = data&#46;charCodeAt(i++); 
         o2 = data&#46;charCodeAt(i++); 
         o3 = data&#46;charCodeAt(i++); 

         bits = o1<<16 | o2<<8 | o3; 
         h1 = bits>>18 & 0x3f; 
         h2 = bits>>12 & 0x3f; 
         h3 = bits>>6 & 0x3f; 
         h4 = bits & 0x3f; 

&#47;&#47; use hexes to index into b64, and append result to encoded string

Code: Select all

         enc += b64&#46;charAt(h1) + b64&#46;charAt(h2) + b64&#46;charAt(h3) + b64&#46;charAt(h4); 
     } while (i < data&#46;length); 

     switch( data&#46;length % 3 ){ 
         case 1: 
             enc = enc&#46;slice(0, -2) + '=='; 
             break; 
         case 2: 
             enc = enc&#46;slice(0, -1) + '='; 
             break; 
     } 
     return enc; 
 }, 

 beforeSearchTwit : function () { 
     &#47;&#47; document&#46;write("Invoking beforeSearchTwit function&#46;"); &#47;&#47; This line completely rewriting content on the page! 
     if (this&#46;bearerToken == ""){ 

&#47;&#47; get bearer token and after that call searchTwit

Code: Select all

            OAuth2DS&#46;execute({}); 
     } else { 
         SearchDS&#46;execute({}); &#47;&#47; why do you need to call this twice? 
     } 
     SearchDS&#46;execute({});   &#47;&#47; added by mf 07-23-13 in attempt to force execution of SearchDS  
     &#47;&#47; document&#46;write("Exiting beforeSearchTwit function&#46;"); &#47;&#47; and again 

 } 

 &#47;&#47; alert('TwitSearchGlobal&#46;beforeSearchTwit run?&#46;'); &#47;&#47; This line causes syntax error 

}
alert('Exiting TwitSearchGlobal&#46;beforeSearchTwit'); &#47;&#47; fires always on start&#46;/code

mikeflores2000
Posts: 0
Joined: Sun May 06, 2012 11:09 pm

Where can I find a simple OAuth plugin I can use for my Twitter Search app?

Hi Katya,

Any reasonable person would understand that the customer is not responsible for debugging Appery code because failing line came directly from
Appery tutorial:
SearchDS.execute({}); // why do you need to call this twice?

Obviously, I DID copy and paste original corrected Appery file without any changes yet it still failed prompting me to add
A)
SearchDS.execute({}); // added by mf 07-23-13 in attempt to force execution of SearchDS

B)
// alert('TwitSearchGlobal.beforeSearchTwit run?.'); // This line causes syntax error
Commented out after I discovered it causes a syntax error so it is benign.

C)
alert('Exiting TwitSearchGlobal.beforeSearchTwit'); // fires always on start.
Adding this alert is another benign change to debug code execution.

Conclusion:
Cache must not have refreshed with corrected code until several days later
and my Mac has consumed 119 GB out of 120 GB capacity throwing swap space
warnings, etc.

I would like to know the best way to force clear cache
( assuming this was the root cause of failure ) other than clearing browser history?
I'm using Chrome Version 28.0.1500.95

Obliterate the following items from:

Clear browsing history

Clear download history

Delete cookies and other site and plug-in data

Empty the cache

Clear saved passwords

Clear saved Autofill form data

Clear data from hosted apps

Deauthorize content licenses

Regards,

Mike

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Where can I find a simple OAuth plugin I can use for my Twitter Search app?

I agree that code from our tutorial should work. But this is just sample code, not Appery.io generated code. Appery.io code is the UI or mapping, for example. You would be writing the same code to connect to Twitter using any other tool. Hope this clears things up.

Return to “Issues”