Here are the notes for my program, which I use to outline what exactly I want the program to do:
Go to specific links at specific times. Ex. Go to Facebook at 12pm.
Login with username.
(OPTIONAL) Send alert to phone about each time logged in.
Only thing is, I'm relatively new in programming so I need a little help knowing where to start on creating this.
I would use selenium if I were you. It allows you to automate web browser tasks, such as going to a site and logging in and such. You could keep a dictionary of sites, times, and usernames and use those accordingly. Sending an alert to your phone could be done in a number of ways. You could send an email using SMTP, a built-in python library, that would probably be the best method of communicating with other devices simply.
Related
We are currently developing a python program that as part of its functionality sends noreply E-Mails to customers whenever something important happens. For testing we are sending them from a free noreply#gmail.com address using pythons smtplib library and that works without problems so far.
However when going live we want to change the address to a proper noreply#company.com address. We are already using Google workspaces and have user accounts with company E-Mails. But while reading up on how to get that to work I came across multiple guides and articles which were either confusing, outdated or don't really do what I was hoping for. So I have a few questions that I hope you could answer.
Do I have to create a new user account just for the noreply mails? I have read about aliases and groups but I am not sure that this is the right way to do it since the mails shouldn't be sent from a renamed existing user account. I'd rather not set up a user just for sending E-Mails.
How many mails can I send when it is all set up? Free accounts can send 500 daily, workspace users have 2000, up to 10000 with smtp relay (if that's possible)? If the program ever exceeds this limit is there any way to increase it or should I already look for an alternative.
Finally how do I set this up? Most guides are for the old Gsuite. I feel like there should be an easy way to set this up that I am missing. All I'm looking for is creating a generic noreply#company.com address for our project to programmatically send a higher amount of mails.
Thanks for the help.
I'm using rpyc server to get data using selenium when a connection to a client is established, the problem is that the url I'm trying to access occasionally prompts a reCaptcha to fill in order to access the data needed.
I don't really need to find a way to automate a completion, what I do want is to find a way to stream the browser from the server to the client if it encounters a reCaptcha, in a manner that allows the user to interact with the browser, and fill the reCaptcha manually himself, and from there to let the server go on with the rest of his code.
Something similar to Teamviewer's functionality, to implement in my setup.
I actually couldn't find any direction to follow on that subject yet, and couldn't figure out a method to try myself.
If you work with Selenium, then you have the opportunity to programmatically wait for elements or to detect elements. You could just have your program wait for the ReCaptcha element and make an output to the user in the console that he should solve the ReCaptcha. In the background your program already waits for the elements that appear when the ReCaptcha is solved. Once the user has solved the ReCaptcha, the program will automatically resume.
I've got a list of emails that got corrupted by some robots. On my webpage I have a box "sign in to our newsletter" that got abused with fake adresses and now I can't make up the good adresses from the fake adresses.
I would like to write a small script that check the existence of all the adresses one by one preferably without sending an email. The list isn't that long (about 300 email).
Can I do this without breaking anti-spam rules? I know that I should send an email with a link for people to verify their email but I don't really want to do this as the people with real adresses have already opted in my newsletter and they are going to wonder why I ask them to do it again.
I would ideally do this with python as this is my scripting language of choice.
Any solution to this?
I'm not sure how to do it yourself, however, there are services for this. I use Kickbox. I typically use nodejs for the server, but they have a python library Kickbox-python. You can do 100 verifications a day for free, or pay for more. I use it to verify emails when users initially sign up.
EDIT: The kickbox pricing model has changed. Now you get 100 initial verifications free, and pay for any additional verifications after that threshold. Refer to the site for the current pricing plans.
I am trying to make a program on my computer at home that will constantly check a certain gmail address; The purpose being the only email this address receives is from me.
I would just like to be able to
Check for mail
Download mail (presumably to a string, though a file is acceptable), and
Delete the mail from the web server but keep it on my computer.
That is all I need to know right now, however my long term goal is to set up kind of a remote terminal over email, so that wherever I have email I have a certain amount of control over my computer.
As Gabi points out, you should check out libgmail. You might also want to check out twisted python. They have some powerful modules for SMTP, POP3, IMAP, and many more that have nothing to do with email.
If you want to write a program to just process incoming e-mail, take a look at Pythomnic framework: http://www.pythomnic3k.org/
I am building a website for a comedy group which uses Facebook as one of their marketing platforms; one of the requirements for the new site is to display all of their Facebook events on a calendar.
Currently, I am just trying to put together a Python script which can pull some data from my own Facebook account, like a list of all my friends. I presume once I can accomplish this I can move to pulling more complicated data out of my clients account (since they have given me access to their account).
I have looked at many of the posts here, and also went through the Facebook API documentation, including Facebook Connect, but am really beating my head against the wall. Everything I have read seems like overkill, as it involves setting up a good deal of infrastructure to allow my app to set up connections to any arbitrary user's account (who authorizes me). Shouldn't it be much simpler, given I only ever need to access 1 account?
I cannot find a way to retrieve data without having to display the Facebook login window. I have a script which will retrieve all my friends, but it includes a redirect where I have to physically log myself in to Facebook.
Would appreciate any advice or links, I just feel like I must be missing something simple.
Thank you!
Just posting up my notes on the successful advice, should others find this post;
Per Daniel and William's advice, I obtained the right permissions using the Connect options. From William, this link explains how the Facebook connection works
https://developers.facebook.com/docs/authentication/
This section on setting up the actual authentication was most helpful to me.
http://developers.facebook.com/docs/api
Basically, it goes as follows:
Post a link to the following URL. A user will need to physically click on it (even if that user is just you, the site admin).
https://graph.facebook.com/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=http://www.example.com/HANDLER
This will redirect to a Facebook login, which will return to http://www.example.com/HANDLER after the user authenticates. If you wish to do more than basic reads and news feed updates you will need to include this variable in the above link: scope=offline_access,user_photos. The scope variable just includes a comma separated list of values, which Facebook will explicitly tell the authenticating user about during the login process, and they will have to OK. Most helpful for me was the offline_access flag (user_photos lets you get at their photos too), so I can pull content without someone logging in regularly (so long as I store the access token obtained later)
Have a script located at http://www.example.com/HANDLER that will take a variable from the request (so facebook will redirect to http://www.example.com/HANDLER&code=YOUR_CODE after authentication). Your handler needs to pull out the code variable, and then send the following request:
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_CLIENT_ID&
redirect_uri=http://www.example.com/oauth_redirect&
client_secret=YOUR_SECRET_KEY&
code=YOUR_CODE
This request will return a string of the form access_token=YOUR_ACCESS_TOKEN.
Just parse off the 'access_token=', and you will have a token that you can use to access the facebook graph API, in requests like
http://graph.facebook.com/me/friends?access_token=YOUR_ACCESS_TOKEN
This will return a JSON object containing all of your friends
Hope this saves someone else some not fun time straining through documentation. Thanks for the help!
It is true, that Facebook's API is targeted at developers who are creating apps that will be used by many users.
Thankfully, the new Graph API is much simpler to use than its predecessor, and shouldn't be terribly difficult for you to work with without using or creating a lot of underlying infrastructure.
You will need to implement authorization, but this is not difficult, and as long as you prompt the user for the offline_access permission, it'll only need to be done once.
The documentation on Desktop Authentication would probably be most relevant to you at this point, though you might want to move to the javascript-based authentication once you've got a web app up and running.
Once the authentication is done, all you're doing is making GET requests to various urls and working with the resulting JSON.
Here's the documentation about Events, and you can get a list of friends from the friends connection of a User.
I'm not expert on Facebook/Facebook Connect, however I've seen it used/used applications with it and it seems there's really only the 'official' way to do it. I'm afraid it looks like your best bet would probably be something along the lines of this.
http://wiki.developers.facebook.com/index.php/Connect/Authentication_and_Authorization
Regardless of how you actually 'use' it, you'll still need to authorize the application to connect to the account and this means having a Facebook App as well.
The answer to Facebook application authentication is hard to find but is actually found within the "Analytics" page of the Graph API.
Specify the following: https://graph.facebook.com/oauth/access_token?client_cred&client_id=yourappid&client_secret=yourappsecret , you will then be given an access_token that you may use on all other calls.
The Facebook provided APIs do NOT currently provide this level of functionality.