Categories
Geekery

Single PHP file to send push notification via OneSignal REST API

Here’s a single php file where you can send a push notification using your OneSignal account via REST API. It’s simple and straightforward using the code example at OneSignal.com. This one is more complete as the code example is just the curl_setopt code. But what if you don’t know how to POST the code from your form to send a message using the basic example from OneSignal REST API? Example in this link are all just API parameters with basic code example, no actual code example with an HTML form that will work if you copy paste it.

Categories
Geekery

Google Finance API stopped working as of September 2017

If you’re using the Google Finance Exchange Rate API and it suddenly stopped working, then don’t be shocked. At first, I thought they now require an API key, but that assumption vanished in seconds after I noticed that https://www.google.com/finance/converter was redirected to https://finance.google.com/finance/converter. So if you’re using file_get_contents to fetch the latest forex rates at https://www.google.com/finance/converter, just change it to https://finance.google.com/finance/converter and it will work just fine. No other major changes, it’s just that the API is now in the subdomain.

Maybe there are announcements this month, but I’m not subscribed to any. I googled “google finance forex API september 2017” but it seems nobody posted or blogged about it or asked about it in Stack Exchange. So, that’ it. I just want to share it!