core twitter functions implemented in php