So I need to create a web app that does the following. So there is this website with chat, something like Wall, where people post messages. Well, what I need is to get a notification via email when a specific guy make a post. So when "Joe Doe" posts a message, I will immediatelly receive an email. Now, I'm new to this (web apps), but I can pick it up very fast. All I need to do is to understand it. That's why I need you guys to help on what is the best way and how should I do this? What language to use? JavaScript? PHP? What's the logic behind? How does it work? Regards
First question would be - is this a page you control? Or do you need to make something that will scan a page (made by someone else) and notify you if a user (or a set of users) posts?
Well... first of all, what you're trying to do is probably not gonna be welcomed by the site in question, but there are ways to do it - one way would be to use PHP (or some other server-side scripting language) and pull info from the site at regular intervals, and if there's a post by the person or persons you've singled out, you get an email sent to you - it will, however, not be immediate (unless you pull info every second, which will be stressful for both your and their server, and will probably get you blocked). Another way would be to have the site open in a tab in a browser (or in a completely separate browser), and run a javascript (user.js) which refreshes the page, looks for content matching the criteria, and if so, notifies you - however, you can't really send an email via javascript (it's run on the client side, and doesn't have access to an email-server) - so there's that. It's also rather restrictive on what it allows transferred - what you probably could do is create a cookie, and fetch that cookie on another site, even run on localhost, which would then trigger if the cookie is set to "true" or something, and email you. It would however demand that you have the site open at all times and run the js-file.
I was thinking about Chrome extension. And dont worry, there is no site refreshing, because this chat, refreshes itself.
aha - I didn't catch the chat-reference - that might be hard to catch with a server-pull - depends on what you get on a html-request pull, really - I think your best bet is some kind of, as you say, chrome extension or Greasemonkey-script (the latter will work on any browser able to load the Greasemonkey-plugin).
That would be perfectly doable, yes - however, while you could make Greasemonkey send the information in some way, it will be tough to get it to send emails - that would mean you would have to tie it into something else - if it's an open tab somewhere, maybe it could notify you via a messenger app, or post to a similar open Gmail-tab or something - never tried anything like that myself, so not entirely sure what can be achieved.
If its a web app with a live updating chat, then it is already polling the server ever few seconds, using web sockets, Ajax, or similar. Your best bet would be to monitor how this chat is loading new messages, and clone the process in your own application, C#, PHP, etc. The language you choose would primary be dependent on if you want this ran on your local machine, a remote VP server, shared hosting, etc.