From e9b43e1677abb3ecc5be8b4f995db09d77dd76a8 Mon Sep 17 00:00:00 2001 From: John Conway Date: Fri, 17 May 2019 15:46:10 +0100 Subject: Stupid Git --- src/FeedNim.nim | 33 +++++++++++++++++++++++++++++++++ src/feednim.nim | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 src/FeedNim.nim delete mode 100644 src/feednim.nim diff --git a/src/FeedNim.nim b/src/FeedNim.nim new file mode 100644 index 0000000..be9832d --- /dev/null +++ b/src/FeedNim.nim @@ -0,0 +1,33 @@ +import httpclient + +import feednim/atom +import feednim/rss +import feednim/jsonfeed + +proc loadAtom*(filename: string): Atom = ## Loads the Atom from the given ``filename``. + var Atom: string = readFile(filename) # Load the data from the file. + return parseAtom(Atom) + + +proc getAtom*(url: string): Atom = ## Gets the Atom over from the specified ``url``. + var Atom: string = newHttpClient().getContent(url) # Get the data. + return parseAtom(Atom) + + +proc loadRSS*(filename: string): Rss = ## Loads the RSS from the given ``filename``. + var rss: string = readFile(filename) # Load the data from the file. + return parseRSS(rss) + + +proc getRSS*(url: string): Rss = ## Gets the RSS over from the specified ``url``. + var rss: string = newHttpClient().getContent(url) # Get the data. + return parseRSS(rss) + +proc loadJsonFeed*(filename: string): JsonFeed = ## Loads the JSONFeed from the given ``filename``. + var jsonFeed: string = readFile(filename) # Load the data from the file. + return parseJSONFeed(jsonFeed) + + +proc getJsonFeed*(url: string): JsonFeed = ## Gets the JSONFeed over from the specified ``url``. + var jsonFeed: string = newHttpClient().getContent(url) # Get the data. + return parseJSONFeed(jsonFeed) \ No newline at end of file diff --git a/src/feednim.nim b/src/feednim.nim deleted file mode 100644 index be9832d..0000000 --- a/src/feednim.nim +++ /dev/null @@ -1,33 +0,0 @@ -import httpclient - -import feednim/atom -import feednim/rss -import feednim/jsonfeed - -proc loadAtom*(filename: string): Atom = ## Loads the Atom from the given ``filename``. - var Atom: string = readFile(filename) # Load the data from the file. - return parseAtom(Atom) - - -proc getAtom*(url: string): Atom = ## Gets the Atom over from the specified ``url``. - var Atom: string = newHttpClient().getContent(url) # Get the data. - return parseAtom(Atom) - - -proc loadRSS*(filename: string): Rss = ## Loads the RSS from the given ``filename``. - var rss: string = readFile(filename) # Load the data from the file. - return parseRSS(rss) - - -proc getRSS*(url: string): Rss = ## Gets the RSS over from the specified ``url``. - var rss: string = newHttpClient().getContent(url) # Get the data. - return parseRSS(rss) - -proc loadJsonFeed*(filename: string): JsonFeed = ## Loads the JSONFeed from the given ``filename``. - var jsonFeed: string = readFile(filename) # Load the data from the file. - return parseJSONFeed(jsonFeed) - - -proc getJsonFeed*(url: string): JsonFeed = ## Gets the JSONFeed over from the specified ``url``. - var jsonFeed: string = newHttpClient().getContent(url) # Get the data. - return parseJSONFeed(jsonFeed) \ No newline at end of file -- cgit v1.2.3