How do I display text from recent tweet or text from url?

Get help using Construct 2

Post » Wed Aug 03, 2016 4:57 pm

Without being too intrusive, I thought it would be neat to post updates for my project on twitter or as plain text on a website and then have that display in the app on a specific update page.

How would I do that?

I'd like the user to be able to move to that page and then click a button to receive the most recent update and that would make the app set the text field to the most recent tweet or maybe just the text on the specific webpage set up for the task.. whatever is easier, and I imagine it might be easier to pull from plain text on a specific webpage.

Thank you!
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

Post » Wed Aug 03, 2016 6:06 pm

I've been digging and I think I might need to look in to the AJAX plugin, but I'm still lost on how to set the text field to the content of a webpage even if the AJAX plugin can call it. -_-
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

Post » Thu Aug 04, 2016 5:27 pm

Nobody?

:(
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

Post » Thu Aug 04, 2016 9:02 pm

After requesting a website, you can use the trigger condition Ajax On Completed to set text to Ajax.LastData, which contains the results of your AJAX request.

But keep in mind it may not work cross-domain:

By default, browsers block AJAX requests across domains. This means, for example, a game on scirra.com can request other pages on scirra.com, but cannot request pages on facebook.com. This is an important security feature of web browsers (it is not specific to Construct 2 or its AJAX object).


If you're posting on your own site where your project is located, no problem.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303


Return to How do I....?

Who is online

Users browsing this forum: jaytrott86, Lancifer and 8 guests