Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Python Diffbot API Client
# Python Diffbot API Client


##Preface
## Preface
Identify and extract the important parts of any web page in Python! This client currently supports calls to Diffbot's Automatic APIs and Crawlbot.


Expand All @@ -10,7 +10,7 @@ To install activate a new virtual environment and run the following command:

$ pip install -r requirements.txt

##Configuration
## Configuration

To run the example, you must first configure a working API token in config.py:

Expand All @@ -20,9 +20,9 @@ Then replace the string "SOME_TOKEN" with your API token. Finally, to run the e

$ python example.py

##Usage
## Usage

###Article API
### Article API
An example call to the Article API:

```
Expand All @@ -34,7 +34,7 @@ api = "article"
response = diffbot.request(url, token, api, version=2)
```

###Product API
### Product API
An example call to the Product API:

```
Expand All @@ -46,7 +46,7 @@ api = "product"
response = diffbot.request(url, token, api, version=version)
```

###Image API
### Image API
An example call to the Image API:

```
Expand All @@ -58,7 +58,7 @@ api = "image"
response = diffbot.request(url, token, api, version=version)
```

###Analyze API
### Analyze API
An example call to the Analyze API:

```
Expand All @@ -70,7 +70,7 @@ api = "analyze"
response = diffbot.request(url, token, api, version=version)
```

###Crawlbot API
### Crawlbot API
To start a new crawl, specify a crawl name, seed URLs, and the API via which URLs should be processed. An example call to the Crawlbot API:

```
Expand Down Expand Up @@ -117,12 +117,12 @@ To pass additional arguments to a crawl:
sampleCrawl = DiffbotCrawl(token,name,seeds,apiUrl,maxToCrawl=100,maxToProcess=50,notifyEmail="support@diffbot.com")
```

##Testing
## Testing

First install the test requirements with the following command:

$ pip install -r test_requirements.txt

Currently there are some simple unit tests that mock the API calls and return data from fixtures in the filesystem. From the project directory, simply run:

$ nosetests
$ nosetests