Receiving notifications - notifications

I run a parse app that is basically an appointment system but I was wondering if there is a way that my app/parse can notify me when someone sets an appointment? As of right now I receive no emails or any kind of alert so I have to stay on the parse site, and refresh it every 5 minutes.

One thing you could do is write a cloud code pre save function that sends you an email automatically every time an appointment is saved.
https://parse.com/docs/cloud_code_guide#functions-onsave
That link should help you get started on writing a cloud code function on save for your objects.
As far as sending an email from Javascript, I believe it is doable, here is an example of part of a response that could help you:
http://stackoverflow.com/questions/7381150/how-to-send-an-email-from-javascript

Related

Hangouts/Chat - messagesUnread always 0 despite new messages

I'm trying to write a Hangouts/Chat dockapp to show unread message notifications, I'm using the following scope url:
https://www.googleapis.com/gmail/v1/users/me/labels/CHAT?access_token=<my_access_token>
The json returns fine, however messagesUnread is always 0. I've disconnected every possible app/browser etc that could be grabbing the messages before I reloaded the above URL, sent a new chat message from another account and messagesTotal increments by 1 but still the unread stays at 0. Even if I disable hangouts in the gmail web interface settings, send a message and search by "label:chat" the chat message that was received arrives marked as read in the web interface. If I manually mark a chat message as unread then the values in the above url do change correctly.
I can obviously work around this by storing he previous messagesTotal on comparing to current, however that creates a requirement to click the app to acknowledge the unreads which is a tad annoying.
Has anyone found a way to get a true unread count from chats/hangouts?
Thanks,
Haydn.
If you use the method users.labels.get for any other label (e.g. INBOX), it will return messagesUnread correctly.
Unfortunately for the label CHAT this is not the case
Chat messages are not quite the same as emails
It is not clear either it is intended behavior that you cannot retrieve the unread chat messages or a bug
This issue has been already filed on Google's Public Issue Tracker, but it has been closed by Google because it has been reported in Spanish.
Feel free to report the issue in English to hopefully obtain a response from Google eihter the bheavior is intended or a bug.

Embed form in outlook email and capture response

I am trying to help people do their job. So every morning an email needs to go out to the users with a list to Approve/Reject... Don't want to send this email just like a warning, telling them to go to the app to perform their duty. The email needs to have the capability to capture their response and update the DB accordingly.
option 1: Embed all items in single email body as a form, something like...
Code - Description - radiobutton - radio button
111 ABC o Accept o Reject
222 DEF o Accept o Reject
Submit
On submit need to call a winforms app and need to pass the code and accept/reject status. I have not been able to find any thing to come up with a solution. Need to validate as well, making sure all appropriate radio buttons have been selected. Is it even possible?
Option 2: I am trying to avoid voting route where each item will go as a separate email. when the user will accept/reject, a reply will go to the email. Then some process will monitor that inbox and will pick the not read messages and update DB accordingly. Using the MailItemClass in Microsoft.Office.Interop.Outlook namespace.
var mailItem = (Outlook.MailItem)Application.CreateItem(Outlook.OlItemType.olMailItem);
mailItem.To = "some.address#server.com";
mailItem.Subject = "This is a test";
mailItem.Body = "This is the body of the message.";
mailItem.VotingOptions = "Accept; Reject;";
mailItem.Send();
I believe what you are asking for is possible but would be a lot of effort to implement.
For your approach, I assume the information for these emails comes from the DB. I would write a macro to interrogate the DB and create and send each email to the appropriate user.
On each user’s system I would have a rule that recognised these emails and called a macro to process them. The macro would extract the contents of the email, copy it to a form and pass control to the user. A Submit button would validate the user’s choices and save the results in global variables before returning control to the macro. On regaining control, the macro would update the DB.
This macro will be large and I am sure it will need maintenance. To protect itself from malware, Outlook does not provide any easy way of importing macros. The macro and the form will have to be manually imported to each user’s system, each time they change. Unless you have technically able users, it will be you who visits each system and updates it.
I would reject any approach that required code on the user’s systems.
To test an alternative approach, I manually created this email:
and sent it to myself. When I received the email, I actioned it as instructed. When I received the reply, it looked like:
The Html body for this reply is full of formatting information. You could extract the responses from it but I believe the text body would be easier. To create the following, I started with the text body, replaced every carriage return and line feed with [CR] and [LF] and then added a few new lines to make it marginally easier to read.
[CR][LF][CR][LF] [CR][LF][CR][LF]From: Tony Dallimore [mailto:a.j.dallimore#MyIsp.com] [CR][LF]Sent: 25 May 2018 14:22[CR][LF]To: 'Tony Dallimore' <a.j.dallimore#MyIsp.com>[CR][LF]Subject: Test email 2[CR][LF][CR][LF] [CR][LF][CR][LF]
Please:[CR][LF][CR][LF] [CR][LF][CR][LF]
1) Click Reply within the Home tab.[CR][LF][CR][LF]
2) You may find it helpful to click Pop Out.[CR][LF][CR][LF]
3) Enter “A” in the Accept column or “R” in the Reject column of every row in the following table.[CR][LF][CR][LF]
4) Click Send.[CR][LF][CR][LF] [CR][LF][CR][LF]Code[CR][LF][CR][LF]Description[CR][LF][CR][LF]Accept[CR][LF][CR][LF]Reject[CR][LF][CR][LF]
111[CR][LF][CR][LF]ABC[CR][LF][CR][LF]A[CR][LF][CR][LF][CR][LF][CR][LF]
222[CR][LF][CR][LF]DEF[CR][LF][CR][LF][CR][LF][CR][LF]R[CR][LF][CR][LF]
333[CR][LF][CR][LF]GHI[CR][LF][CR][LF]A[CR][LF][CR][LF][CR][LF][CR][LF]
444[CR][LF][CR][LF]JKL[CR][LF][CR][LF]A[CR][LF][CR][LF] [CR][LF][CR][LF]
[CR][LF][CR][LF] [CR][LF]
You would need a second macro to process these emails, extract the responses and update the DB. There is no validation on the user’s system but they are not being asked to do anything complicated. If you telephone and harangue them every time you get an incomplete reply, they will soon realise life is more pleasant if they get it right first time.
I do not know how difficult it is to access your DB from VBA but I do not believe anything else is particularly difficult.
This is not the approach you requested but I believe this will be very much easier to implement. More importantly, all the code is on your system which will make development and maintenance so much easier.

How do I modify the POST data with selenium

I want to query the whole month data 2015-6
I found every POST request will send the following two params
MarketMonth1 2015-6
MarketDay1 17
one is for year-month, the other is for day.
It is too verbosed and time consuming to set the value mimic the mouse clicking on calendar.
I wonder if I can inject/modify the POST params when sending the POST request.
You can not do it directly with WebDriver, but you can direct all your traffic thru a proxy and modify all you need before sending it server. You can check this answer about setting up browsermob.

Sending Data to JS Form from iOS App

The Red Cross has a locator page where you can submit a zip code by means of a form and that runs through a JSP to return contact information for your local Red Cross office.
From an iOS app, I have the user's zip code and would like to run this process and get that contact information back... or at least the appropriate URL to link to. I was hoping I could find some way to pass the zip code by URL but it doesn't look like it's going to be that easy.
Could anyone offer some direction as to how to go about this? I've done some simple things with forms before but I'm not quite sure where to start with this one.
According to the <form> action parameter, that's the URL you have to post your data to:
http://www.redcross.org//portal/site/en/template.MAXIMIZE/ziplocator/;jsessionid=MWwKPvjSWmvz8p4XrRtNLVL0VCTM7fcwfnFnKHpwRhJTnwLMMDcv!-1938881463!-1334769155?javax.portlet.tpst=2bd907ea326f7e9e934afa36c23f78a0_ws_MX&javax.portlet.prp_2bd907ea326f7e9e934afa36c23f78a0_viewID=result&javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken&vgnextoid=6d65e821cbdf9110VgnVCM1000002bf3870aRCRD
The field name is zipcode. The AFNetworking documentation is quite okay explaining how to send a POST request. I would also recommend the nsscreencasts series, he has an episode on AFNetworking as well.
I hope this helps. :)
You can use NSURLConnection to execute a post request and return the result, you may have to do some parsing of the result though depending on the format it is returned in.
Here is an example:
http://forums.macrumors.com/showthread.php?t=689884
NSURLConnection documentation:
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsurlconnection_Class/Reference/Reference.html

From email to shared hosted backend to remote frontend

So my friend hosts a little get together every once in a while where space is limited to the first 14 people who RSVP. He emails the invite out to a list and then accepts the first people who respond. Tonight I barely got in because I can't always check my email, so I told him that I would write a program that would respond instantly to his request. This would not normally be a problem (autoresponder, easy) except he has recently created an online signup form. I think it would be funny for him to send out his next invite and get a sub-100ms response from me, so I would like to give this a try.
The problem is, I'm not quite sure how to go about it without going to to much expense. I have a personal site that can host some .NET backend code, but it's on a shared GoDaddy server so I don't really have a ton of access to the mailserver or anything. I was thinking that if I could get an email sent to a certain address that maybe it could trigger a webrequest that could pull down his page and then fill the (very simple, like 2 or 3 inputs) form out and submit it, but again, I'm not quite sure how.
Would anyone have an idea about how I could go about this? I would want for this to happen automatically without any sort of interaction from me, just basically as soon as I get an email from a certain email address, somehow my code is triggered and the form filled out and submitted.
This is just for fun, but the programmer in me is curious as to how I could actually get this to work.
Thanks!
The most affordable thing I know of would be through NearlyFreeSpeech.NET. If you set up an account there, you can configure a domain with email forwarding for 3 cents/day. They have an option to forward the email to a script, so you could write something that would look at the mail, pull down the form, and post to a server.
I'm not sure but I think the script has to be running on their servers, so you'll have to set up a website (another few cents per day) and write the script to run in a UNIX environment (PHP or Perl or such). If you insist on .NET, you could write a minimal PHP script to forward the data to your GoDaddy account.