Same PHP code for making WhatPub API requests