All Projects → dfloureiro → News-API-Kotlin

dfloureiro / News-API-Kotlin

Licence: Apache-2.0 license
Access the News API with Kotlin.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to News-API-Kotlin

NewsApp
An app that fetches latest news, headlines
Stars: ✭ 28 (-20%)
Mutual labels:  news, newsapi
HeadLines
HeadLines is a 📰 news app that delivers you with the latest news. It has interactive UI and easy to use. The app can be scrolled offline to watch your bookmarked news. Give this app a try and let me know.
Stars: ✭ 16 (-54.29%)
Mutual labels:  news, newsapi
BoxFeed
News App 📱 built to demonstrate the use of SwiftUI 3 features, Async/Await, CoreData and MVVM architecture pattern.
Stars: ✭ 112 (+220%)
Mutual labels:  news, newsapi
Inshorts-News-API
Unofficial API of Inshorts written in Flask
Stars: ✭ 87 (+148.57%)
Mutual labels:  news, newsapi
newsemble
API for fetching data from news websites.
Stars: ✭ 42 (+20%)
Mutual labels:  news, newsapi
NewsPin
News app for android using Kotlin, coroutines, MVP architecture
Stars: ✭ 25 (-28.57%)
Mutual labels:  news, newsapi
covid19.swift
🌐 Small iOS app to show some COVID-19 health, data, news and tweets
Stars: ✭ 25 (-28.57%)
Mutual labels:  news, newsapi
react-native-news-app
Get breaking news headlines with short description filtered by your interests and country preferences
Stars: ✭ 75 (+114.29%)
Mutual labels:  news
civic-scraper
Tools for downloading agendas, minutes and other documents produced by local government
Stars: ✭ 21 (-40%)
Mutual labels:  news
django-calaccess-raw-data
A Django app to download, extract and load campaign finance and lobbying activity data from the California Secretary of State's CAL-ACCESS database
Stars: ✭ 61 (+74.29%)
Mutual labels:  news
GamerClubWeb
🎮 A gaming news frontend, base on vuetify
Stars: ✭ 17 (-51.43%)
Mutual labels:  news
kobe-every-shot-ever
A Los Angeles Times analysis of Every shot in Kobe Bryant's NBA career
Stars: ✭ 66 (+88.57%)
Mutual labels:  news
PopularNews
📰 News application using the API from newsapi.org
Stars: ✭ 68 (+94.29%)
Mutual labels:  newsapi
Diurna
Basic/Classic Hacker News app, used as a Cocoa & Swift learning platform
Stars: ✭ 100 (+185.71%)
Mutual labels:  news
extractnet
A Dragnet that also extract author, headline, date, keywords from context
Stars: ✭ 52 (+48.57%)
Mutual labels:  news
jser.github.io
JSer.infoのブログリポジトリ
Stars: ✭ 90 (+157.14%)
Mutual labels:  news
flutter redux
A Flutter Starter Application
Stars: ✭ 25 (-28.57%)
Mutual labels:  news
coronastats
A simple web app which shows updates about COVID-19
Stars: ✭ 18 (-48.57%)
Mutual labels:  news
HungryHippo
🦛 scrapes websites and generates rss feeds
Stars: ✭ 33 (-5.71%)
Mutual labels:  news
PressCenters.com
News aggregator for the press releases of the Bulgarian government sites written in ASP.NET Core
Stars: ✭ 91 (+160%)
Mutual labels:  news

News-API-Kotlin

This is a Kotlin API Wrapper SDK for the https://newsapi.org. Go to the website to get your apiKey. This can be used for both Android and regular Java/Kotlin projects.

How to import:

Gradle:

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add the dependency:

dependencies {
        implementation 'com.github.dfloureiro:news-api-kotlin:v2.1'
}

Maven:

<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>

Add the dependency:

<dependency>
    <groupId>com.github.dfloureiro</groupId>
    <artifactId>news-api-kotlin</artifactId>
    <version>v2.1</version>
</dependency>

How to use examples:

Create an instance of NewsApi:

    val newsApiRepository = NewsApiRepository("myApiKey")

Get top headlines by category/country/query:

    newsApiRepository.getTopHeadlines(category = Category.GENERAL, country = Country.US, q = "trump", pageSize = 20, page = 1)
            .subscribeOn(Schedulers.io())
	.toFlowable()
            .flatMapIterable { articles -> articles.articles }
            .subscribe({ article -> Log.d("getTopHead CC article", article.title) },
                    { t -> Log.d("getTopHeadlines error", t.message) })

Get top headlines by sources/query:

    newsApiRepository.getTopHeadlines(sources = "bbc-news", q = "trump", pageSize = 20, page = 1)
            .subscribeOn(Schedulers.io())
            .toFlowable()
            .flatMapIterable { articles -> articles.articles }
            .subscribe({ article -> Log.d("getTopHead S article", article.title) },
                    { t -> Log.d("getTopHeadlines error", t.message) })

Search articles from the full repo with everything:

    newsApiRepository.getEverything(q = "bitcoin", sources = "bbc-news", domains = null, from =  "2018-01-01", to = "2018-02-13", language = Language.EN, sortBy = SortBy.POPULARITY, pageSize = 20, page = 1)
            .subscribeOn(Schedulers.io())
            .toFlowable()
            .flatMapIterable { articles -> articles.articles }
            .subscribe({ article -> Log.d("getEverything article", article.title) },
                    { t -> Log.d("getEverything error", t.message) })

Get available sources:

    newsApiRepository.getSources(category = Category.GENERAL, language = Language.EN, country = Country.US)
            .subscribeOn(Schedulers.io())
            .toFlowable()
            .flatMapIterable { sources -> sources.sources }
            .subscribe({ source -> Log.d("source", source.name) },
                    { t -> Log.d("getSources error", t.message) })

Used technologies:

KOTLIN

https://github.com/JetBrains/kotlin

KODEIN

https://github.com/Kodein-Framework/Kodein-DI

RETROFIT

https://github.com/square/retrofit

RXKOTLIN

https://github.com/ReactiveX/RxKotlin

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].