Page 1 of 1

sending a message to automagic

Posted: 24 Jan 2014 04:12
by rsegoly
Hi
I used before to send a message to Automagic using plugin like Autoremote which can interacts with the web.
Autoremote used as trigger when a message received or even when it matched a pattern.
But it's not a clean solution and Autoremote as a tool is too complicated and too many parameters and options.
So I am looking for a way better way to trigger Automagic from the Web.
One option is to let Automagic initiate the request and access url which will answer with parameters such as
http://212.150.200.169:84/school_post.p ... on=display
But I wonder if that's the best way, and am also concerned about battery usage if it probs the URL every minute or so.

Re: sending a message to automagic

Posted: 24 Jan 2014 06:10
by rsegoly
I just found notifymyandroid which can trigger automagic as intent broadcast.
The content of the message which is sent by NMAmail is HTML, can I extract the data?

Re: sending a message to automagic

Posted: 24 Jan 2014 08:36
by Martin
Hi,

You could probably receive the NMA event using a trigger General Broadcast.
Set the action to com.usk.app.notifymyandroid.NEW_NOTIFICATION (it's also available in the selection list) and use the following script in the extras-field:
app=getString("app");
event=getString("event");
desc=getString("desc");
prio=getInt("prio", 0);
url=getString("url");

This will make the variables app, event, desc, prio and url available to the flow.
You can also add a condition Debug Dialog to show the variables and the corresponding values.

What kind of HTML text do you get, can you post an example? According to the NMA documentation HTML tags should be removed.

Regards,
Martin

Re: sending a message to automagic

Posted: 24 Jan 2014 09:40
by rsegoly
the html code is only when the message is sent by their email interface.
the description is html code

Re: sending a message to automagic

Posted: 24 Jan 2014 09:50
by Martin
I can not see their own interface for mail. I was using a regular mail client to send a mail to <key>@nmamail.net. Can you post a link to their mail interface?

Re: sending a message to automagic

Posted: 24 Jan 2014 09:55
by rsegoly
I meant the way you described. What do you get as message on device? Plian text?

Re: sending a message to automagic

Posted: 24 Jan 2014 10:21
by Martin
Aha, seems like they don't strip the HTML tags when you send a HTML mail, not sure what following sentence on their page relates to then:
All html code will be stripped if the message is not plain/text
I would configure the mail client to send plain text only mails to nmamail.net. Correctly stripping HTML tags within Automagic could be difficult, but I've never tried.