Skip to content

Commit 476e980

Browse files
committed
Update Readme
1 parent b253e23 commit 476e980

3 files changed

Lines changed: 23 additions & 20 deletions

File tree

README.rst

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ Here is a simple example and then we will go into the objects::
2828
>>> from embedly import Embedly
2929
>>> client = Embedly(:key)
3030
>>> obj = client.oembed('http://instagr.am/p/BL7ti/')
31-
>>> obj.type
32-
u'photo'
3331
>>> obj['type']
3432
u'photo'
35-
>>> obj.url
33+
>>> obj['url']
3634
u'http://distillery.s3.amazonaws.com/media/2011/01/24/cdd759a319184cb79793506607ff5746_7.jpg'
3735

3836
>>> obj = client.oembed('http://instagr.am/p/error')
39-
>>> obj.error
37+
>>> obj['error']
4038
True
4139

4240
Embedly Client
@@ -53,12 +51,22 @@ The client object now has a bunch of different methods that you can use.
5351

5452
``oembed``
5553
Corresponds to the `oEmbed endpoint
56-
<http://embed.ly/docs/endpoints/1/oembed>`_. Passes back a simple object that
57-
allows you to retrieve a title, thumbnail, description and the embed html::
54+
<http://embed.ly/docs/embed/api/endpoints/1/oembed>`_. Passes back an object
55+
that allows you to retrieve a title, thumbnail, description and the embed
56+
html::
5857

5958
>>> client.oembed('http://vimeo.com/18150336')
6059
<embedly.models.Url at 0x10223d950>
6160

61+
``extract``
62+
Corresponds to the `Extract endpoint
63+
<http://embed.ly/docs/extract/api/endpoints/1/extract>`_. Passes back an
64+
object that allows you to retrieve a title, description, content, html and a
65+
list of images.::
66+
67+
>>> client.extract('http://vimeo.com/18150336')
68+
<embedly.models.Url at 0x10223d950>
69+
6270
``preview``
6371
Corresponds to the `Preview endpoint
6472
<http://embed.ly/docs/endpoints/1/preview>`_. Passes back a simple object
@@ -120,26 +128,21 @@ attributes. We will go through a few, but you should read the `documentation
120128
# Url Object can be accessed like a dictionary
121129
>>> obj['type']
122130
u'video'
123-
# Data can also be accessed like attributes
124-
>> obj.type
125-
u'video'
126-
# Invalid attributes are returned as None
127-
>>> obj.notanattribute
128131

129-
# The url object always has an ``orginal_url`` attrbiute.
132+
# The url object always has an ``original_url`` attrbiute.
130133
>>> obj.original_url
131134
u'http://vimeo.com/18150336'
132-
# The method used to retrive the URL is also on the obj
135+
# The method used to retrieve the URL is also on the obj
133136
>>> obj.method
134137
u'oembed'
135138

136139
For the Preview and Objectify endpoints the sub objects can also be accessed in
137140
the same manner.
138141

139142
>>> obj = client.preview('http://vimeo.com/18150336', words=10)
140-
>>> obj.object.type
143+
>>> obj['object']['type']
141144
u'video'
142-
>>> obj.images[0].url
145+
>>> obj['images'][0].url
143146
u'http://b.vimeocdn.com/ts/117/311/117311910_1280.jpg'
144147

145148
Error Handling
@@ -150,11 +153,11 @@ an error. For example if we use an invalid key, we will get a 401 response back
150153

151154
>>> client = Embedly('notakey')
152155
>>> obj = client.preview('http://vimeo.com/18150336', words=10)
153-
>>> obj.error
156+
>>> obj['error']
154157
True
155-
>>> obj.error_code
158+
>>> obj['error_code']
156159
401
157160

158161
Copyright
159162
---------
160-
Copyright (c) 2011 Embed.ly, Inc. See LICENSE for details.
163+
Copyright (c) 2013 Embed.ly, Inc. See LICENSE for details.

embedly/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import absolute_import
22
from .client import Embedly
33

4-
__version__ = '0.4.3'
4+
__version__ = '0.4.4'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
setup(
2020
name = 'Embedly',
21-
version = '0.4.3',
21+
version = '0.4.4',
2222
author = 'Embed.ly, Inc.',
2323
author_email = 'support@embed.ly',
2424
description = 'Python Library for Embedly',

0 commit comments

Comments
 (0)