I need a light script, compatibles with Mailgun API with 2 main features.
The first feature should be able to get all bounces from a domain in mailgun, and store them in a local file.
The parameters are API URL (in the code), API key (in the code), DOMAIN (text field)
How to do this is here http://documentation.mailgun.net/api-bounces.html
The second feature should read a local file with emails, and unsubcribe all those emails from a given domain.
The parameters are API URL (in the code), API key (in the code), DOMAIN (text fiels), the file where emails are stored.
How to do is here http://documentation.mailgun.net/api-unsubscribes.html
It is best if the file for script 1 can be use by script 2.
The script should not use MySQL, only XML or CSV files.