Skip to main content

A basic microblog/rss feed crawler modeled after the Tweepy StreamListener.

Project description

A basic feed crawler/parser for traversing microblog and RSS feeds.

The crawler’s API is modeled afer the Tweepy StreamListener API. To use the crawler, subclass it and fill in the methods for the on_event methods. The crawler is meant to be quick and simple since it is designed to work close to real time. In later versions features may be added to address this directly (multiprocessing, simpler processing, etc).

The crawler provides very basic control over the crawling process. The crawler can be forced to start upon instantiation, or at a later time. The crawler also has an API for graceful termination and progress checking.

Upon instantiation, or when the on_start method is called, provide a list of feed URLs to crawl. The list can be modified either during instantiation, or during this callback. The progress indicator will indicate the progress of the crawler through the list. When the crawler finishes the list, it will start over until the stop call is made.

Providing a start_time to the crawler will cause the crawler to only callback to the on_item callback when an item has been found with a pubdate element value of that time or later. Regardless of the given start_now value after the initial pass, the crawler will only callback to posts it has not seen before.

Providing the deep_traversal option will force the crawler to crawl all past pages of a given URL (if they exist). By default, the crawler will parse the first 2 pages of the given URL every time, but will stop after that.

The crawler returns Python dictionary representations of the element objects it finds in almost every callback excluding the on_data callback which recieves the raw text of the URL response. In cases where the crawler encounters an error, the crawler will pass a dictionary with the following structure to the on_error callback.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MicroblogCrawler-1.3.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file MicroblogCrawler-1.3.0.tar.gz.

File metadata

File hashes

Hashes for MicroblogCrawler-1.3.0.tar.gz
Algorithm Hash digest
SHA256 96e07bcaa51f3530766e48aa7e71313b764ed9f6edca9cb125dadcc6322e5dfc
MD5 3c08a9a09bc6de36538c5ca81ec03a0f
BLAKE2b-256 39fb85a3a19509fd5ad25246cf710d027bfc0d00e56390841af809bbb0b94fc9

See more details on using hashes here.

File details

Details for the file MicroblogCrawler-1.3.0.macosx-10.5-x86_64.tar.gz.

File metadata

File hashes

Hashes for MicroblogCrawler-1.3.0.macosx-10.5-x86_64.tar.gz
Algorithm Hash digest
SHA256 22e9a2765374b4467c09aa19890cfe92a648e9cebd254f7b9335eac2a2470ec8
MD5 0eb83244a7f4803a99bd47933c28fd78
BLAKE2b-256 f60122c0af0adba7f91eb8160d433f150276b056baedad65f765d233962e0a73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page