Permalink
Browse files

Merge pull request #14 from Gonzih/master

Couple of minor improvements
  • Loading branch information...
scsibug committed Nov 19, 2017
2 parents 4af2db8 + a4495ed commit 6dd3aa07ee9e41c2a723892b90756966dc1d4e62
Showing with 1,387 additions and 97 deletions.
  1. +4 −3 .gitignore
  2. +7 −0 .travis.yml
  3. +8 −8 README.markdown → README.md
  4. +4 −4 project.clj
  5. +1,236 −0 resources/fixtures/gonzih-blog.xml
  6. +85 −78 src/feedparser_clj/core.clj
  7. +43 −4 test/feedparser_clj/test/core.clj
View
@@ -1,3 +1,4 @@
-/lib/
-/feedparser-clj-0.3.jar
-/pom.xml
+target/
+.nrepl-port
+.lein-failures
+.lein-repl-history
View
@@ -0,0 +1,7 @@
+jdk:
+ - openjdk7
+ - oraclejdk7
+ - oraclejdk8
+
+language: clojure
+script: lein test
@@ -1,4 +1,4 @@
-feedparser-clj
+feedparser-clj [![Build Status](https://travis-ci.org/Gonzih/feedparser-clj.svg?branch=master)](https://travis-ci.org/Gonzih/feedparser-clj)
==============
Parse RSS/Atom feeds with a simple, clojure-friendly API.
@@ -33,9 +33,9 @@ The following REPL session should give an idea about the capabilities and usage
Load the package into your namespace:
- user=> (ns user (:use feedparser-clj.core) (:require [clojure.contrib.string :as string]))
+ user=> (ns user (:require [feedparser-clj.core] [clojure.string :as string]))
-Retrieve and parse a feed:
+Retrieve and parse a feed:
user=> (def f (parse-feed "http://gregheartsfield.com/atom.xml"))
@@ -55,7 +55,7 @@ Retrieve and parse a feed:
`f` is now a map that can be accessed by key to retrieve feed information:
user=> (keys f)
- (:authors :categories :contributors :copyright :description :encoding :entries :feed-type :image :language :link :entry-links :published-date :title :uri)
+ (:authors :author :categories :contributors :copyright :description :encoding :entries :feed-type :image :language :link :entry-links :published-date :title :uri)
A key applied to the feed gives the value, or nil if it was not defined for the feed.
@@ -92,10 +92,10 @@ Find the most recently updated entry's title:
user=> (first (map :title (reverse (sort-by :updated-date (:entries f)))))
"Version Control Diagrams with TikZ"
-Compute what percentage of entries have the word "haskell" in the body (uses `clojure.contrib.string`):
+Compute what percentage of entries have the word "haskell" in the body (uses `clojure.string`):
- user=> (let [es (:entries f)]
- (* 100.0 (/ (count (filter #(string/substring? "haskell"
+ user=> (let [es (:entries f)]
+ (* 100.0 (/ (count (filter #(string/substring? "haskell"
(:value (first (:contents %)))) es))
(count es))))
55.55555555555556
@@ -117,4 +117,4 @@ Distributed under the BSD-3 License.
Copyright
---------
-Copyright (C) 2010 Greg Heartsfield
+Copyright (C) 2010 Greg Heartsfield
View
@@ -1,6 +1,6 @@
-(defproject org.clojars.scsibug/feedparser-clj "0.5.0"
+(defproject org.clojars.gnzh/feedparser-clj "0.6.0"
:description "Parse RSS/Atom feeds with a simple, clojure-friendly API."
- :dependencies [[org.clojure/clojure "1.6.0"]
- [org.jdom/jdom "2.0.2"]
- [net.java.dev.rome/rome "1.0.0"]]
+ :dependencies [[org.clojure/clojure "1.8.0"]
+ [org.jdom/jdom2 "2.0.6"]
+ [net.java.dev.rome/rome "1.0.0"]]
:main feedparser-clj.core)
Oops, something went wrong.

0 comments on commit 6dd3aa0

Please sign in to comment.