Latest 1.0
Homepage https://github.com/akapoorx00/StackAPI
License MIT
Platforms ios 10.0
Dependencies Kanna, SwiftyJSON
Authors

A unofficial StackOverFlow API to get the required answer for a topic. The Framework works using the StackOverFlow API to get the urls of the questions and then uses Kanna (Web Scraping (xpath)) to scrap the first answer from the url.

Example

let api = StackOverFlowAnswerAPI(query: "swift")
api.getPossibleQuestions { (data) in
    for d in data {
        print(d.title,d.url) // Tht title of the question related to Swift and its URL.

        var scraper = Scraper(forUrl: d.url)
        scraper.scrape(completion: { (title, answer) in
            print(title, answer) // The title of the question and the its answer.
        })
    }
}

Installation

Install using Cocoapods

    pod 'StackAPI'

Contact:Email

Email: [email protected]

Contact:Facebook

Facebook: www.facebook.com/aadit.kapoor71

Latest podspec

{
    "name": "StackAPI",
    "version": "1.0",
    "summary": "A unofficial StackOverFlow API to get the answer text from a stackoverflow url.",
    "description": "A unofficial StackOverFlow API to get the required answer for a topic.nThe Framework works using the StackOverFlow API to get the urls of the questions and then uses Kanna (Web Scraping (xpath)) to scrap the first answer from the url.",
    "homepage": "https://github.com/akapoorx00/StackAPI",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Aadit Kapoor": "[email protected]"
    },
    "source": {
        "git": "https://github.com/akapoorx00/StackAPI.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "StackAPI/*",
    "dependencies": {
        "Kanna": [
            "2.1.0"
        ],
        "SwiftyJSON": []
    },
    "xcconfig": {
        "HEADER_SEARCH_PATHS": "$(SDKROOT)/usr/include/libxml2"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This