Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
北京理工大学本科生毕业设计答辩JWeiBo: an SDK Solution for Sina WeiBo          RESTful Open API       Date: 06/08/2011   Mentor: Dai Yinta...
Outline1. Background2. Related work3. Requirement4. Design5. Implementation6. Sample codes7. Future work
Background                             Microblogging’s characters   Microblogging’s bombing development  Increasing      ...
Background                                        RESTful Web Services          1: The base URL (or URI) for the Web Servi...
Related Work                                        JWeiBo’s role                  1: Request from outside.         2: Dat...
Requirement             Function                                    Data flow in swim lane    1: The request parameters co...
Design                           Architecture of JWeiBo         1:   Initializing API.         2:   Constructing Request. ...
Design         Program interface between classes
Implementation           HTTPHTTPManager(SinaWeiBoHTTPManager)HTTP Basic:      encodedBasic="Basic"+new String(new      BA...
Implementation   HTTPHTTPManager(SinaWeiBoHTTPManager)OAuth:             Steps in OAuth authentication
Implementation         ResponseResponse(SinaWeiBoResponse)Data format:      XML, JSON.Ultimate Container:      JavaBean (S...
Sample codesSource Code:api = SinaWeiBo.builder().initialize(appKey,appSecret).build();request = ((SinaWeiBo)api).publicTi...
Acknowledgments        It has been a great pleasure to work with my advisorDai Yintao, during the course E-Commerce and th...
Upcoming SlideShare
Loading in …5
×

本科毕业设计答辩

615 views

Published on

Published in: Technology
  • ⇒⇒⇒WRITE-MY-PAPER.net ⇐⇐⇐ has really great writers to help you get the grades you need, they are fast and do great research. Support will always contact you if there is any confusion with the requirements of your paper so they can make sure you are getting exactly what you need.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

本科毕业设计答辩

  1. 1. 北京理工大学本科生毕业设计答辩JWeiBo: an SDK Solution for Sina WeiBo RESTful Open API Date: 06/08/2011 Mentor: Dai Yintao Student: Deng Litao
  2. 2. Outline1. Background2. Related work3. Requirement4. Design5. Implementation6. Sample codes7. Future work
  3. 3. Background Microblogging’s characters Microblogging’s bombing development  Increasing demands for third-party applications.
  4. 4. Background RESTful Web Services 1: The base URL (or URI) for the Web Services. 2: The Internet media type for the data supported by the Web Services, XML and JSON.3: The set of operations of HTTP methods defined on the resources, such as GET, POST, PUT and DELETE.
  5. 5. Related Work JWeiBo’s role 1: Request from outside. 2: Data demand from Controller to Model. 3: Data interchange between application and Sina WeiBo. 4: Data from Model to Controller. 5: Data from Controller to View. 6: Response to outside.
  6. 6. Requirement Function Data flow in swim lane 1: The request parameters could be viewed as the input. 2: Initializing the HTTP call.3: Invoke the HTTP call by specified scheme. Finally, the HTTP headers and body can be used as the output.
  7. 7. Design Architecture of JWeiBo 1: Initializing API. 2: Constructing Request. 3: HTTP Transaction. 4: Fetching Response.
  8. 8. Design Program interface between classes
  9. 9. Implementation HTTPHTTPManager(SinaWeiBoHTTPManager)HTTP Basic: encodedBasic="Basic"+new String(new BASE64Encoder().encode((credential.getUsername() +":"+ credential.getPassword()).getBytes())); httpGet.addHeader("Authorization", encodedBasic);
  10. 10. Implementation HTTPHTTPManager(SinaWeiBoHTTPManager)OAuth: Steps in OAuth authentication
  11. 11. Implementation ResponseResponse(SinaWeiBoResponse)Data format: XML, JSON.Ultimate Container: JavaBean (Status, User, Comment, Emotion……). private long id, String screen_name; public void assignXML(Element elem), assignJSON(JSONObject jsonObject){} public static List<User> parseXML(Document document), parseJSON(JSONArray jsonArray){} public static User parseXMLAsElement(Document document), parseJSONAsObject(JSONObject jsonObject) public static List<User> parseJSONAsHybrid(JSONObject jsonObject){ @Override public String toString(), boolean equals(Object object), int hashCode()
  12. 12. Sample codesSource Code:api = SinaWeiBo.builder().initialize(appKey,appSecret).build();request = ((SinaWeiBo)api).publicTimeline().count(10).build();response = request.httpCall();System.out.println(response.toString());statuses = PublicTimeline.parser(response).parse();for(Status status : statuses){ System.out.println(status.toString());}Output:XML JSON
  13. 13. Acknowledgments It has been a great pleasure to work with my advisorDai Yintao, during the course E-Commerce and the graduationproject; he impressed me a lot by his critical thinking andkindness. Zhao Fengnian also deserves a great of thanks, for heintroduced me to the Web Technology and led to all of the workI have done about the applications and systems on network. I would like to thank all of my classmates whoaccompanied me through the graduation project; you gave me somany strong encouragements and selfless cares.

×