readit 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. data/.travis.yml +12 -0
  2. data/Gemfile +3 -1
  3. data/Readme.md +61 -5
  4. data/features/bookmarks.feature +9 -9
  5. data/features/readability.yml.sample +6 -0
  6. data/features/step_definitions/api_steps.rb +4 -4
  7. data/lib/readit/version.rb +1 -1
  8. data/lib/readit.rb +89 -11
  9. data/spec/cases/api_spec.rb +29 -6
  10. data/spec/cases/parser_spec.rb +19 -0
  11. data/spec/cases/tags_spec.rb +46 -0
  12. data/spec/cassettes/Readit_API/can_add_tags_to_one_bookmark.yml +699 -0
  13. data/spec/cassettes/Readit_API/can_fetch_all_tags_information_of_current_user.yml +45 -0
  14. data/spec/cassettes/Readit_API/can_fetch_tags_of_one_bookmark.yml +687 -0
  15. data/spec/cassettes/Readit_API/can_get_bookmark_location_when_bookmarked_a_url.yml +52 -0
  16. data/spec/cassettes/Readit_API/can_get_meta_infos_of_bookmarks.yml +646 -0
  17. data/spec/cassettes/Readit_API/can_remove_tag_info_of_one_bookmark_by_tag_id.yml +786 -0
  18. data/spec/cassettes/Readit_API/should_add_bookmark.yml +52 -0
  19. data/spec/cassettes/Readit_API/should_get_bookmarks_according_to_added_since.yml +86 -0
  20. data/spec/cassettes/Readit_API/should_get_the_article_content.yml +322 -0
  21. data/spec/cassettes/Readit_API/should_get_the_bookmark_info_by_bookmark_id.yml +713 -0
  22. data/spec/cassettes/Readit_API/should_get_user_infos.yml +51 -0
  23. data/spec/cassettes/Readit_API/should_get_user_s_bookmarks.yml +634 -0
  24. data/spec/cassettes/Readit_API/should_provide_the_bookmark_id_of_an_already_bookmarked_url.yml +683 -0
  25. data/spec/cassettes/Readit_API/should_update_bookmark_to_archive.yml +808 -0
  26. data/spec/cassettes/Readit_API/should_update_bookmark_to_favarite.yml +808 -0
  27. data/spec/cassettes/Readit_Parser/should_return_parsed_article_cotents.yml +638 -0
  28. data/spec/readability.yml.sample +7 -0
  29. data/spec/spec_helper.rb +28 -1
  30. metadata +65 -11
  31. data/readability.yml.sample +0 -3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.readability.com/api/rest/v1/bookmarks
6
+ body:
7
+ encoding: US-ASCII
8
+ string: url=http%3A%2F%2Fwww.jslib.org.cn%2Fnjlib_xsyj%2F201011%2Ft20101130_98154.htm
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - OAuth gem v0.4.7
14
+ Content-Length:
15
+ - '0'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ Authorization:
19
+ - OAuth oauth_consumer_key="<TOKENS>", oauth_nonce="xJHXiSuhXbqkEu49fK5v0woxOQH4rWazwYxcHB7ocbY",
20
+ oauth_signature="8j%2FJ3nxvQQ3s%2BKe4fMv%2Ft0s3r58%3D", oauth_signature_method="HMAC-SHA1",
21
+ oauth_timestamp="1361335757", oauth_token="<TOKENS>", oauth_version="1.0"
22
+ response:
23
+ status:
24
+ code: 409
25
+ message: CONFLICT
26
+ headers:
27
+ Content-Type:
28
+ - application/json
29
+ Date:
30
+ - Wed, 20 Feb 2013 04:49:14 GMT
31
+ Location:
32
+ - https://www.readability.com/api/rest/v1/bookmarks/3644001
33
+ P3p:
34
+ - CP='Legacy Only. Go to https://readability.com/about/terms/ for full terms.'
35
+ Server:
36
+ - nginx/1.2.1
37
+ Set-Cookie:
38
+ - readabilityToken=4FCRyvwJt8enJ7LvesTWKphGwNRyT5h9B3t5KWfP; expires=Wed, 20-Mar-2013
39
+ 04:49:14 GMT; Max-Age=2419200; Path=/
40
+ Vary:
41
+ - Authorization, Cookie
42
+ Content-Length:
43
+ - '117'
44
+ Connection:
45
+ - keep-alive
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"meta": {"redirect": true, "existing_bookmark": 3644001}, "messages":
49
+ ["Bookmark already exists."], "success": true}'
50
+ http_version:
51
+ recorded_at: Wed, 20 Feb 2013 04:49:18 GMT
52
+ recorded_with: VCR 2.0.1