Skip to content

Commit

Permalink
Merge pull request #21 from parenthesin/more-prepare-4-initial-release
Browse files Browse the repository at this point in the history
More prepare 4 initial release
  • Loading branch information
rafaeldelboni committed Nov 8, 2019
2 parents 105c782 + 28be639 commit 35a32b6
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 31 deletions.
22 changes: 2 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
# Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).

## [Unreleased]
### Changed
- Add a new arity to `make-widget-async` to provide a different widget shape.

## [0.1.1] - 2019-09-23
### Changed
- Documentation on how to make the widgets.

### Removed
- `make-widget-sync` - we're all async, all the time.

### Fixed
- Fixed widget maker to keep working when daylight savings switches over.

## 0.1.0 - 2019-09-23
## 0.1.0 - 2019-11-04
### Added
- Files from the new template.
- Widget maker public API - `make-widget-sync`.

[Unreleased]: https://github.com/your-name/splashed/compare/0.1.1...HEAD
[0.1.1]: https://github.com/your-name/splashed/compare/0.1.0...0.1.1
- Basic functionality to all open unsplash api.
62 changes: 59 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,71 @@
Clojure wrapper for the Unsplash API
=======

A Clojure library designed to ... well, that part is up to you.
Clojure wrapper for the [Unsplash API](https://unsplash.com/documentation)

## Setup

- First you need to create a unsplash developer account and register an application, you can check [here](https://unsplash.com/documentation#creating-a-developer-account) for more information.

- After you created your application you can get your access key [here](https://unsplash.com/oauth/applications/).

- Add the following dependency to your project.clj file:

```
[org.parenthesin/splashed "0.1.0"]
```

## Usage

FIXME
```clojure
(ns your.app.namespace.core
(:require [org.parenthesin.splashed.core :as splashed]))

;; Bellow are some samples of how use this wrapper

;; Get a single page from the list of all photos.
(splashed/photos-list {} {:access-key "YOUR-APP-ACCESS-KEY"})

;; Retrieve a single photo by id
(splashed/photos-by-id "tYnFSqELn54" {:access-key "YOUR-APP-ACCESS-KEY"}

;; Retrieve a single random photo, given optional filters.
(splashed/photos-random {} {:access-key "YOUR-APP-ACCESS-KEY"})

;; Retrieve total number of downloads, views and likes of a single photo by id, as well as the historical breakdown of these stats in a specific timeframe (default is 30 days).
(splashed/photos-statistics-by-id "tYnFSqELn54" {} {:access-key "YOUR-APP-ACCESS-KEY"})

;; To abide by the API guidelines, you need to trigger a GET request to this endpoint every time your application performs a download of a photo.
(splashed/photos-download-by-id "tYnFSqELn54" {:access-key "YOUR-APP-ACCESS-KEY"})

;; Get a single page of five photos results for a query.
(splashed/search-photos {:query "corgi" :per-page 5 :page 1} {:access-key "YOUR-APP-ACCESS-KEY"})

;; Get a single page of collection results for a query.
(splashed/search-collections {:query "corgi"} {:access-key "YOUR-APP-ACCESS-KEY"})

;; Get a single page of user results for a query.
(splashed/search-users {:query "rafael delboni"} {:access-key "YOUR-APP-ACCESS-KEY"})

;; Get a single page from the list of all collections.
(splashed/collections-list {} {:access-key "YOUR-APP-ACCESS-KEY"})

;; Get a single page from the list of featured collections with only 2 items per page.
(splashed/collections-featured {:page 1 :per-page 2} {:access-key "YOUR-APP-ACCESS-KEY"})

;; Retrieve a single collection by the collection id.
(splashed/collections-by-id 1410291 {:access-key "YOUR-APP-ACCESS-KEY"})

;; Retrieve a collection’s photos by the collection id
(splashed/collections-photos-by-id 1410291 {:access-key "YOUR-APP-ACCESS-KEY"})

;; Retrieve a list of collections related to this one id.
(splashed/collections-related-by-id 1410291 {:access-key "YOUR-APP-ACCESS-KEY"})
```

## License

Copyright © 2019 FIXME
Copyright © 2019 Parenthesin

This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
Expand Down
8 changes: 0 additions & 8 deletions src/org/parenthesin/splashed/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@
[{:keys [page per-page order-by] :as params} options]
(photos nil params options))

(defn photos-curated
[{:keys [page per-page order-by] :as params} options]
(photos "curated" params options))

(defn photos-by-id
[id options]
(photos id nil options))
Expand Down Expand Up @@ -146,10 +142,6 @@
[{:keys [page per-page] :as params} options]
(collections "featured" params options))

(defn collections-curated
[{:keys [page per-page] :as params} options]
(collections "curated" params options))

(defn collections-by-id
[id options]
(collections id nil options))
Expand Down

0 comments on commit 35a32b6

Please sign in to comment.