C# Class DiffBot.DiffbotAPI

Exibir arquivo Open project: TheRightChoyce/diffbot-csharp Class Usage Examples

Public Methods

Method Description
Article ( string url, bool useHtml = false ) : DiffBotArticleResultModel

Parse out an article by URL and return a strongly typed object

ArticleGetPreview ( DiffBotArticleResultModel article ) : string

Gets a basic 300 word preview for this article, or if this is a video, returns the proper embed tag for the video contents

Frontpage ( string url, bool useHtml = false ) : DiffBotFrontpageResultModel

Parses a Frontpage

GetEndpointUrl ( string type, string url, bool useHtml = false ) : string

Constructs and returns the appropriate Url for this endpoint

Protected Methods

Method Description
DownloadUrlAsString ( string url ) : string

This grabs the raw URL and returns it in string form.

GetBodyFromHtmlString ( string html ) : string

Not yet implemented

GetTitleFromHtmlString ( string html ) : string

Returns a page's title element from a raw html string

Private Methods

Method Description
GetWebClient ( ) : WebClient
IsValidUrl ( string url, System &uri ) : bool

Determines if the provided url is actually a valid url to parse

Method Details

Article() public method

Parse out an article by URL and return a strongly typed object
public Article ( string url, bool useHtml = false ) : DiffBotArticleResultModel
url string
useHtml bool
return DiffBotArticleResultModel

ArticleGetPreview() public method

Gets a basic 300 word preview for this article, or if this is a video, returns the proper embed tag for the video contents
public ArticleGetPreview ( DiffBotArticleResultModel article ) : string
article DiffBotArticleResultModel
return string

DownloadUrlAsString() protected method

This grabs the raw URL and returns it in string form.
protected DownloadUrlAsString ( string url ) : string
url string
return string

Frontpage() public method

Parses a Frontpage
public Frontpage ( string url, bool useHtml = false ) : DiffBotFrontpageResultModel
url string
useHtml bool
return DiffBotFrontpageResultModel

GetBodyFromHtmlString() protected method

Not yet implemented
protected GetBodyFromHtmlString ( string html ) : string
html string
return string

GetEndpointUrl() public method

Constructs and returns the appropriate Url for this endpoint
public GetEndpointUrl ( string type, string url, bool useHtml = false ) : string
type string
url string
useHtml bool
return string

GetTitleFromHtmlString() protected method

Returns a page's title element from a raw html string
protected GetTitleFromHtmlString ( string html ) : string
html string
return string