 |
|
 |
How would this work in MVC? I am very new to the world of programming.
|
|
|
|
 |
|
 |
I Am Getting the Error "Initializing error! Please check the Customer key and Customer secret key".
What Are the values that we need to provide in "CustomerKey" and "CustomerSecretKey" in Credentials.cs page ?
I Am Using Google Authentication.
Thanks in Advance
|
|
|
|
 |
|
|
 |
|
 |
I'm getting the error when run this code.
The error is "Initializing error! Please check the Customer key and Customer secret key."
How to get the Customer key and Customer secret key? and How to use on this code?
Do you have any code to display the user profile information in a web page?
|
|
|
|
 |
|
 |
Customer key and Customer secret key are the key through which we can instantiate the oAuth process. These key are the registration code(lets say) of a company with Social sites. I am giving an example of facebook of how to register an app.
Go the url:
https://developers.facebook.com/apps[^]
You will be asked password 2 times. Coming into the page, look at the top right side. There is a button "Create App". Follow the process to register. Then at last you will get Customer key and Customer secret key. Once you are done please follow the instructions given in section "Facebook integration (Version 2.0)" in the article.
This way you can register in other social sites too. I think you are a new bee. So please look into this tutorial also to know about OAuth http://hueniverse.com/oauth/[^]
I have a web page that displays the profile responses returned from different social sites. http://tipsplusarticles.com/entries/articles/article-oauth-profile-response-json-data[^]
How to display the profile data in a web page is completely up to you. Moreover you can see the code of deserializing the json data in Dictionary at http://tipsplusarticles.com/entries/tips/tip-parse-json-data-to-dictionary-object-in-c[^]
Then you can use sever script to whatever data you want to display.
Hope i answered you queries.
|
|
|
|
 |
|
 |
Do you have the example for Google? And How to use this in Asp.Net web application using C#?
|
|
|
|
 |
|
 |
I Am Getting the Error "Initializing error! Please check the Customer key and Customer secret key".
What Are the values that we need to provide in "CustomerKey" and "CustomerSecretKey" in Credentials.cs page ?
I Am Using Google Authentication.
|
|
|
|
 |
|
 |
I am making a web-application in ASP.NET as a college project. I have used your code to get profile fields of a linkedin user. I need the names of the companies followed by the user, but the problem is that the default value is set to 20. so, if the user is following more than 20 companies i am not able to get it. Please tell me how can i modify the start and count values. Iv used this url to make the call http://api.linkedin.com/v1/people/~:(following:(people,companies,industries,news-sources),educations).. Please help asap..
The company has default value of start set to 0 and count to 20. i need all the companies followed or at least 50 .. i need to add "?start=0&count=50" i tried it but got error.. i even tried in the OAuthContext.cs line:278 case "linkedin": queryString = "?format=xml&start=0&count=50"; break;
I even tried to add it in the public static string RequestProfileUrl = "http://api.linkedin.com/v1/people/~:(id,headline,industry,interests,educations:(id,school-name,degree,field-of-study),following:(companies:(id,name,size,industry),industries),three-current-positions)";
nothing worked.. i tried on the net but dint find.. Please help!!! i badly need it..
|
|
|
|
 |
|
 |
Hi,
I am very busy now a days. I need some time to look into this. I will try as soon as possible.
Thanks
|
|
|
|
 |
|
 |
Thank you sir for the consideration.. Please help me as soon as possible...
|
|
|
|
 |
|
 |
Hi,
Please do the following steps:
1) go to line 668 of OAuthContext.cs. Replace the existing if()... with
if (oauthParameter.Name.ToLower() == "scope" || oauthParameter.Name.ToLower() == "format" || oauthParameter.Name.ToLower() == "count") continue;
2) In the same file go to CreateQuerystring() function give for linkedin
case "linkedin": queryString = "?count=50&format=json"; break;
3) What ever RequestProfileUrl you have mentioned is OK. If that doesn't work please test with "http://api.linkedin.com/v1/people/~/following/companies"
Say, if this solved your issue.
|
|
|
|
 |
|
 |
Thank you so so much sir... It worked like a charm.. Extremely great full...
|
|
|
|
 |
|
 |
thanks a lot very useful and fantastic code
but i have a problem ,
after getting user information it is a string like :
{"id":"1263024141","name":"Behrad Izadi","first_name":"Behrad","last_name":"Izadi","link":"http:\/\/www.facebook.com\/behradizadi","username":"behradizadi","work":[{"employer":{"id":"141996369166564","name":".NET Programmer"},"start_date":"0000-00"},{"employer":{"id":"153462128000209","name":"Objective-C Programmer"},"start_date":"0000-00"}],"sports":[{"id":"105650876136555","name":"Tennis"},{"id":"105788652787522","name":"Swimming"},{"id":"108614982500363","name":"Basketball"}],"education":[{"school":{"id":"193416737353743","name":"Electrical & Electronics Engineering (EEE)"},"type":"College","classes":[{"id":"103778226326865","name":"Master's Degree"}]}],"gender":"male","email":"izadi.be\u0040gmail.com","timezone":8,"locale":"en_US","languages":[{"id":"105666109466078","name":"Persian"},{"id":"113301478683221","name":"American English"}],"verified":true,"updated_time":"2012-03-18T20:12:29+0000"}
How can id get all information separably ?
i mean , firstname = ? , lastnaem =? , email=?
and ..
thanks
|
|
|
|
 |
|
 |
Well Behrad, it is a matter of how you handle the json string. In my code, i have used the following code to first Deserialize and store it in a Dictionary<>. Then using linq to extract the properties. The code is as follow:
var responseText = oauthContext.GetProfileResponse();
var profileData = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(responseText);
Then using linq we can extract like:
var firstName = _oAuthProfileData.FirstOrDefault(u => u.Key == "first_name").Value.ToString();
One thing is also noticeable that the above linq statement get direct value as we are looking for "first_name" which is at the root level of json string. For searching "sports" for eg. it will return another Dictionary which you have to query futher.
Hope this helps. I hope you are using asp.net with C#
|
|
|
|
 |
|
|
 |
|
 |
Quote: Very clear and concise..
Thanks
HSB
|
|
|
|
 |
|
 |
Excellent Article...Superb Sachin
|
|
|
|
 |
|
 |
bom dia,
para o facebook está com erro na chamada href="https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&client_secret={2}&code=THE_CODE_FROM_ABOVE retornando "Invalid verification code format", você ja tomou este erro?
Tks
|
|
|
|
 |
|
 |
Hi,
there must be some error with customer key and customer secret you are using. Please re-check these. Apart from this i have updated the article to assist user for facebook integration (versio 2.0). Some basic steps i have mentioned in the section. Please follow these and test again. I love to hear your reply. Due to some tight schedule i was unable to reply you earlier. Sorry for this.
Thank
|
|
|
|
 |
|
 |
Great code thank you, very simple to use compared to other .net libraries.
|
|
|
|
 |
|
 |
Hi Sachin,
Really nice content But can you please add functionality for LINKEDIN to get connections or contacts for the current login user.
Thanks in advance,
Abhishek
|
|
|
|
 |
|
 |
i tried the following URL in desktop successfully :
http://api.linkedin.com/v1/people/~/connections[^]
But in ur web applications it generating error:
The remote server returned an error: (401) Unauthorized. by the line "response = request.GetResponse();"
|
|
|
|
 |
|
 |
Hi Abhishek, Sorry for the late response, i was bit busy. I have tested for getting user profile response for all 4 clients. I havn't tested my code for getting contact list. Very soon i will work on getting contact list, there might be some small changing needed for that. Thanks for indicating.
|
|
|
|
 |
|
 |
it worked for me without much of changes.
|
|
|
|
 |