Archive

Archive for the ‘api’ Category

sending e-mails from your app.

If you want to send e-mails from your application, check out https://www.mailgun.com/. You can register for free and with your free account you can also send a good number of e-mails. And if you pay for it, you can send thousands of mails if you want. Their service can be used from Bash, Python, PHP, etc.

On my VPS I used a command-line solution (see here) that sends e-mails with sendmail. Unfortunately, Gmail treats these mails as spam, so it’s not appropriate for sending messages to other people. Mailgun is a better solution.

Advertisements
Categories: api, bash, python Tags: ,

weather information

January 23, 2016 Leave a comment

Problem
You need a free weather API.

Solution
Use http://openweathermap.org. See the API description here.

Example:

http://api.openweathermap.org/data/2.5/weather?q=budapest&appid=44db6a862fba0b067b1930da0d769e98&units=metric

Sample output:

{
	"coord": {
		"lon": 19.04,
		"lat": 47.5
	},
	"weather": [
		{
			"id": 600,
			"main": "Snow",
			"description": "light snow",
			"icon": "13n"
		},
		{
			"id": 701,
			"main": "Mist",
			"description": "mist",
			"icon": "50n"
		}
	],
	"base": "cmc stations",
	"main": {
		"temp": -4,
		"pressure": 1034,
		"humidity": 85,
		"temp_min": -4,
		"temp_max": -4
	},
	"wind": {
		"speed": 2.1,
		"deg": 100
	},
	"clouds": {
		"all": 90
	},
	"dt": 1453579200,
	"sys": {
		"type": 1,
		"id": 5724,
		"message": 0.0092,
		"country": "HU",
		"sunrise": 1453530015,
		"sunset": 1453563103
	},
	"id": 3054643,
	"name": "Budapest",
	"cod": 200
}

As can be seen, the temperature in this city is -4 Celsius.

Categories: api Tags: ,

Rotten Tomatoes has an API

June 12, 2015 Leave a comment

If you want to get info about a movie (e.g. rating, cast, etc.), there is imdbpy, which collects data from IMDb. I just found that Rotten Tomatoes has an API too: http://developer.rottentomatoes.com/.

Update (20150622): about two weeks ago I asked for an API key. I’ve got no response since then…

Update (20150623): I got an answer from them! Here it is:

Thank you for your interest in the Rotten Tomatoes API. Unfortunately, we are unable to grant access at this time.

Due to changes in our syndication program, we're currently only offering free API access to domestic students. This may change in the future as we add additional tiers to the program.

-The Rotten Tomatoes Team
Categories: api Tags: , , ,