sending a message to automagic

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

sending a message to automagic

Post by rsegoly » 24 Jan 2014 04:12

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.

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Re: sending a message to automagic

Post by rsegoly » 24 Jan 2014 06:10

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?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: sending a message to automagic

Post by Martin » 24 Jan 2014 08:36

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

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Re: sending a message to automagic

Post by rsegoly » 24 Jan 2014 09:40

the html code is only when the message is sent by their email interface.
the description is html code

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: sending a message to automagic

Post by Martin » 24 Jan 2014 09:50

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?

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Re: sending a message to automagic

Post by rsegoly » 24 Jan 2014 09:55

I meant the way you described. What do you get as message on device? Plian text?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: sending a message to automagic

Post by Martin » 24 Jan 2014 10:21

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.

Post Reply