I visited the school last week and joined the developer group. I didn't plan to do anything in the school.ProgramBecause it has been copying Facebook, and has recently accelerated the speed of plagiarism. The new style was copied in a few days. It is amazing.
Later, I checked the API and looked at the group. I didn't find the complete. Net implementation. I just want to write a play.
To be honest, I did not write components for a long time, or even did not write them at all. I can only say that I am a trainer. I have previously written an API-encapsulated assembly, as though I have been writing components until now, I am using a desktop program.
On-campus documents are incomplete, but I was familiar with Facebook documents. These methods and parameters on-campus documents are exactly the same as those on Facebook. However, many of them are not supported yet ..
It took about three days to read Facebook's documents to familiarize yourself with internal APIs (the more difficult it was to read), and then wrote an assembly to encapsulate 12 methods of internal APIs, I have published the project in codeplex, and there are also posts in the xcube group on campus.
The purpose of xiaoneinet writing is to make it easier to develop third-party applications. Instead of worrying about API calls and responses, you can directly develop websites and create an application on campus, the deployment is complete. However, I have no idea how to make such an application.
Assembly andSource codeAnd examples, there is a document (generated with sandcastle) Here download: http://www.codeplex.com/XiaoneiNet/Release/ProjectReleases.aspx? Releaseid = 16268
The usage is very simple.CodeSection:
Code
1 // Step 1: Prepare Parameters
2 String Apikey = Request [ " Xn_sig_api_key " ];
3 String Sessionkey = Request [ " Xn_sig_session_key " ];
4 String Secret = " Appsecret " ;
5
6 String Encodedsessionkey = Httputility. urlencode (sessionkey );
7
8 // Step 2: instantiate the apiclient class
9 VaR Client = New Xiaonei. API. apiclient (apikey, secret, encodedsessionkey );
10
11 // Step 3: Call the instance method to obtain the corresponding data
12 VaR friends = Client. friendsgetfriends ();
13
14 // Step 4: Use internal data
15 Foreach (VAR friend In Friends)
16 {
17 Response. Write (friend. Name );
18 }
I hope you will be grateful if you can tell me something unpleasant about the code! Thank you.
1 // Step 1: Prepare Parameters
2 String Apikey = Request [ " Xn_sig_api_key " ];
3 String User = Request [ " Xn_sig_user " ];
4 String Sessionkey = Request [ " Xn_sig_session_key " ];
5 String Secret = " Appsecret " ;
6
7 Int UID = 0 ;
8 Int32.tryparse (user, Out UID );
9
10 String Encodedsessionkey = Httputility. urlencode (sessionkey );
11
12 // Step 2: instantiate the apiclient class
13 VaR Client = New Xiaonei. API. apiclient (apikey, secret, encodedsessionkey, UID );
14
15 // Part 3: Call the instance method to obtain the corresponding data
16 VaR friends = Client. friendsgetfriends ();
17
18 Foreach (VAR friend In Friends)
19 {
20Response. Write (friend. Name );
21}
22