Script for Online Tasks - bots

I was wondering if there is a way to write a script that could perform online tasks . There are actions a user does that is so repetitive/planed, that make me wonder if there is a way i could write a script that could do that for me. What i mean is, for example, a script that could go online, lets say facebook, write/read a post. It seems such a straight forward action that it has to be possible to be done by a scrip.
The thing is I have no idea how to do, my question here is some guidance, if possible, all i need to know is a good language for this and a good aproach. I can't seem to find anything for this, probably not searching the right terms.
Thanks for your time. :)

If you're looking to mock user behavior in the browser (such as filling out a form), you could use Python, a web driver, and the module Selenium.
Selenium will open the web driver, then allow you to mock user actions, such as selecting a text box, typing data, and then clicking submit. This allows you automate actions such as a search on a website, verifying a website works the way you expect it to when a user takes certain actions, and filling out input elements on a page and submitting a form.

You need to understand concepts like javascript, ajax, servlets plus advance level concepts like in advance java as these all are event associated for bringing dynamisation to your web page and other than this session level concepts to deal if session is active or expired this all adds to automating based on session attribute.
Finally, at database level you can use triggers to event fire changes when needed.

Related

How to defend from bot update?

I am guessing this should be already answered on SO but I am a noob, so lacking the proper terminology.
I have a website that lets logged in users to post comments on my articles. Post is pretty straightforward. So creating a script to post data is trivial task. How do I stop users from abusing the system? I am not talking about ddos attack. Just normal script that posts regularly and keeps my server busy.
In my case, user can post or update comment to an article. I am thinking if I should restrict user to n (probably 10) number of times they can update a comment. But how efficient is that?
What are some best way to detect abusing users and how to keep my server unaffected by them?
I know it's not an easy take to do so, but what are the best known practises. My site is hosted on AWS (EC2). Any services they have in place to fix this kind of attacks?
don't let new users do everything right at the start, like on SO
if you think it's a bot, demand a CAPTCHA value
include honeypot (hidden) form fields and disregard input if they are filled in

Simple web crawler / scraper for deals

For fun and maybe for profit, i want to implement the following:
scheduled or manually triggered process that logs into all my bank accounts
process knows bank site structure, and goes through "cashback/partner deals" pages
all deal information is collected in one place and in one format
when i'm going to buy something, i can quickly see if any of my cards has a special offer for that place. so that i can pay with the card that offers the best deal. ideally, this should happen on my android phone. that doesn't imply a standalone app though, e.g. you can search inside an email or googledoc or anything.
any ideas on implementation? don't limit yourself. suggest crazy things, as long as they work.
PS i did look for an existing website that offers something similar, but they all seem to focus on cards themselves rather than on specific deals for stores.
Depending on the bank website, your code may need to be able to execute JavaScript to interact with it. Take a look at CasperJS for the web scraping part.

Creating session mechanism with core nodejs

I am trying to create a complete session managment in nodejs for logins, chat sessions etc.
I googled a lot and every solution that i got was with some framework/module. I don't want to use any module/framework. I would rather like to build my own solution for this:
So this is the plan:
I will set a session cookie on the client machine (yet to figure out how)
For each cookie, i will be maintaining a unique id in the database instead of files as is the case with php (i am using mongodb)
When a user opens the application, a cookie will be set, a entry will be made in database and corresponding information from the db will be fetched.
I am yet to lay a concrete plan for this. I wanted to know whether doing it this way is a good idea? i read somewhere....'Real men don't use any framework. They make everything on their own' :P
Please correct me if i am on a wrong direction. M just starting with these things....
I'm not aware of any node.js frameworks that are closed-source. Just pick one that seems to do what you want to do, download it, and study the source code to see how the developer implemented it. Then come up with your (perceived) improvement on how they did it. You'll probably find that implementing session management involves a whole bunch of nitpicky details that were never obvious to you.
Ignore all the above advice if this is a school assignment where you're not allowed to look at related code. If that's the case, I pity you because you have an incompetent teacher.

What is the most efficient way to mock a user flow in a RESTful application?

How can I communicate in a very simple and effective way the path the user takes through my application?
I'm currently working in a Ruby and Rails environment, so I tend to visualize my application in terms of RESTful URIs. So for example, if I want my users to sign up, I could match a new route called /users/new. The thing is, I would like to see beyond that specific action, and visualize how many pages or forms does it take to create an account and some business logic associated with the process in general. In other words, I'd like to see a mix of a workflow diagram and some implementation details (at an interface level).
I was thinking in showing mockup pictures wrapped in boxes, and relate them through arrows with their corresponding GET, POST, PUT, DELETE methods and URIs attached to them. I think it is a good idea, but I haven't seen examples yet that inspire me.
In your experience, what helps you see the big picture? Balsamiq mockups allow to define links and navigate through the app, but it doesn't help to conceptualize.
Have you thought of using a mind-map? You could try the free FreeMind
If you stick with UML, you could consider an Activity diagram.
I think you're on the right path. Showing different screens with possible combinations of users' transactions between them is a good technique. Basically you would be able to show user's flow through your application and stress out decisions a user will make on the way.
The good example for it was presented here http://vimeo.com/43869717
This technique called Storyboarding. You should be able to find some examples. But the one I mentioned above is one of the best Storyboarding techniques. I use it all the time to show the big picture and present application workflow from user perspective to my team.

Legally parsing browser history

I want to create a service that suggests things based on the sites one has visited. It would be a user controllable process. In other words, the service would start "recording / suggesting" from the users browsing history only tell the service to start (and stop).
I'm not looking for hacks or potentially illegal methods. Technically would this be possible with Javascript as (say) something like a bookmarklet? Or would it need something with more fundamental browser access like an extension?
Thanks in advance for any guidance.
You would need an extension to get access to this much data and it'll have to be custom for each browser.

Resources