diff --git a/README.md b/README.md index 8900b37..c8439ba 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,48 @@ ReadSharp was previously **PocketSharp.Reader** and is now hosted without the [P ## What's it all about? -The library extracts the main content of a website and returns the extracted content as HTML and it's associated title, as well as other useful content (images, icons, ...). +The library extracts the main content of a website and returns the extracted content as HTML and it's associated title, description, favicon and a all included images. This content can be encapsulated in a ``-Tag and displayed as a readable website with a custom CSS (it's up to you!). +ReadSharp is based on a custom PCL port of NReadability and SgmlReader, which are included in the solution. + +#### Association with Pocket + +This library is a replacement for the Article View API by Pocket, which is not only limited by usage and privacy, but also in it's way of extracting contents from websites. + --- +## Example + +```csharp +using ReadSharp; + +Reader reader = new Reader(); +Article article; + +try +{ + article = await reader.Read("http://frontendplay.com/story/4/http-caching-demystified-part-2-implementation"); +} +catch (Exception exc) +{ + // handle exception +} +``` + +## Article Model + +The `Article` contains following fields: + +- `string` **Title** (the title of the page) +- `string` **Description** (description of the page, extracted from meta information) +- `string` **Content** (contains the article) +- `Uri` **FrontImage** (main page image extracted from meta tags like apple-touch-icon and others) +- `Uri` **Favicon** (the favicon of the page) +- `List` **Images** (contains all images found in the text) +- `string` **NextPage** (contains the next page URI, if available) + ## Supported platforms diff --git a/ReadSharp/Reader.cs b/ReadSharp/Reader.cs index 58a0e59..4ca23e8 100644 --- a/ReadSharp/Reader.cs +++ b/ReadSharp/Reader.cs @@ -60,7 +60,7 @@ namespace ReadSharp // add user agent string version = Assembly.GetExecutingAssembly().FullName.Split(',')[1].Split('=')[1]; - _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", string.Format(_userAgent, "; ReadSharp/" + version)); + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", String.Format(_userAgent, "; ReadSharp/" + version)); }