From acd52ba274662c28c183573c463d55da9e8243c7 Mon Sep 17 00:00:00 2001 From: imba3r Date: Tue, 9 May 2017 08:54:10 +0200 Subject: [PATCH] Updated readme. --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0753e34..d33b00b 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,14 @@ To use it in your application, import `github.com/mrobinsn/go-newznab/newznab` ## Library Usage -Initialize a client: +### Initialize a client: ``` -client := newznab.New("http://my-usenet-indexer/api", "my-api-key", 1234, false) +client := newznab.New("http://my-usenet-indexer", "my-api-key", 1234, false) ``` +Note the missing `/api` part of the URL. Depending on the called method either `/api` or `/rss` will be appended to the given base URL. A valid user ID is only required for RSS methods. -Search using a tvrage id: +### Search using a tvrage id: ``` categories := []int{ newznab.CategoryTVHD, @@ -34,7 +35,7 @@ categories := []int{ results, _ := client.SearchWithTVRage(categories, 35048, 3, 1) ``` -Search using an imdb id: +### Search using an imdb id: ``` categories := []int{ newznab.CategoryMovieHD, @@ -43,22 +44,22 @@ categories := []int{ results, _ := client.SearchWithIMDB(categories, "0364569") ``` -Search using a name and set of categories: +### Search using a name and set of categories: ``` results, _ := client.SearchWithQueries(categories, "Oldboy", "movie") ``` -Get latest releases for set of categories: +### Get latest releases for set of categories: ``` results, _ := client.SearchWithQuery(categories, "", "movie") ``` -Load latest releases via RSS: +### Load latest releases via RSS: ``` results, _ := client.LoadRSSFeed(categories, 50) ``` -Load latest releases via RSS up to a given NZB id: +### Load latest releases via RSS up to a given NZB id: ``` results, _ := client.LoadRSSFeedUntilNZBID(categories, 50, "nzb-guid", 15) ```