Category: PHP

Condition based MySQL left join with CASE

Happy to write post after long time 🙂 I had a scenario that there is are some fields in a table like `id`,`group`,`object_id`. `group` field(ENUM) has three groups named `user`, `deal`, `scene` and `object_id`(it will have the primary key for corresponding group). ie., If the row has group name of `user`, then `object_id` refers to […]

Read More…

Migrate Twitter API from Version 1 to 1.1

My twitter feed response is started showing below message when i was tried to access users_timeline using this URL https://api.twitter.com/1/statuses/user_timeline.xml?include_entities=true&include_rts=true&screen_name=karthi0110&count=1 “The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.” I have tried by replacing version 1 to 1.1 in the request URL https://api.twitter.com/1.1/statuses/user_timeline.xml?include_entities=true&include_rts=true&screen_name=karthi0110&count=1 it shown “Bad Authentication data” error. […]

Read More…

Convert long url to short url using tinyurl api

Tinyurl provides us a short and simple service to convert long URL to small(tiny) URL. We can send email without link breakage.Here is the tinyurl api to get shorten url. You can use any of the method. Method 1: Use file_get_contents to fetch tinyurl. echo file_get_contents(‘http://tinyurl.com/api-create.php?url=http://www.websnippetz.com’); file_get_contents is not working? If your are able to […]

Read More…