Latest 0.1.1
Homepage https://github.com/popuparchive/AudiosearchClientSwift
License MIT
Platforms ios 8.0
Dependencies p2.OAuth2, Alamofire
Authors

Swift client for Audiosear.ch API : https://www.audiosear.ch/

See docs at https://www.audiosear.ch/developer/

OAuth credentials are available from https://www.audiosear.ch/oauth/applications

Example:

First, add pod 'AudiosearchClientSwift', '~> 0.1.1' to the podfile.

import 'AudiosearchClientSwift'

//create a client instance
let audiosearch = Audiosearch(id: YOUR_CLIENT_ID, secret: YOUR_CLIENT_SECRET, redirect_urls: [YOUR_URLS])

//fetch a show with id 60
self.audiosearch.getShowById(60) { (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
 }

//fetch a show matching query string
self.audiosearch.getShowBySearchString("You Must Remember This") { (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
}

//fetch a person by ID
self.audiosearch.getPersonById(101){ (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
}

//get related content
self.audiosearch.getRelated("shows", id: 20) { (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
}

//get trending on Twitter
self.audiosearch.getTrending() { (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
}

//get Tastemakers
self.audiosearch.getTastemakers("shows", number: 5){ (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
}

//get Tastemakers by source
self.audiosearch.getTastemakersBySource("episodes", number: 5, tasteMakerId: 2) { (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
}

//get episode snippet
self.audiosearch.getEpisodeSnippet(399, timestampInSecs: 100) { (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
}

//customized search
self.audiosearch.search("2016 presidential campaign", params: ["filters[network]":"NPR", "size": "5", "from": "30" ], type:   "episodes") { (responseObject:AnyObject?, error:NSError?) in
            if (error != nil) {
                print(error)
            } else {
                print(responseObject)
            }
}

Latest podspec

{
    "name": "AudiosearchClientSwift",
    "version": "0.1.1",
    "summary": "A Swift sdk for authenticating application use with the Audiosear.ch API.",
    "description": "The AudiosearchClientSwift authenticates entire applications using client credential oauth2. It also makes several built-in methods available for querying use.",
    "homepage": "https://github.com/popuparchive/AudiosearchClientSwift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Anders Howerton": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/popuparchive/AudiosearchClientSwift.git",
        "tag": "0.1.1"
    },
    "source_files": "*.{swift,h,m}",
    "exclude_files": "Classes/Exclude",
    "dependencies": {
        "p2.OAuth2": [],
        "Alamofire": [
            "~> 3.0"
        ]
    }
}

Pin It on Pinterest

Share This