Wednesday, December 3, 2014

Copy all the lines from a file using vim to another

First open the file using 'vim'.

e.g. vim testfile.txt

Then to copy use "ggVGy" or ":%y a", now the content is in the clipboard.

Open a new terminal and open a new file with 'vim' where you are going to paste it.

Then use "p" or "P" to put the content in the file from the clipboard.

Thursday, November 13, 2014

Instagram user profile details by username or userid

There are actually 3 methods to get profile details of a specific instagram user.

Method 1

Condition : you need to have the user id and the users access token to get the profile details

call the url with user id and access token. 
'https://api.instagram.com/v1/users/USER_ID?access_token=ACCESS_TOKEN'


Method 2

Condition : you need a client id (which can be created from : http://instagram.com/developer/clients/register/) & user id

call the url with user id and client id. 
'https://api.instagram.com/v1/users/USER_ID?client_id=CLIENT_ID'


Method 3

There are some private profiles which cannot be directly accessed using the above 2 methods, for that you can use the search endpoint with the client id to get the matching results and then get the respective user details.

Condition : you need a client id (which can be created from : http://instagram.com/developer/clients/register/) & user id

call the url with user name and client id to search the user. 
'https://api.instagram.com/v1/users/search?q=USER_NAME&client_id=CLIENT_ID'