Removed direct call to mercury api.
This commit is contained in:
@ -7,7 +7,7 @@ import retrofit2.Call
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.converter.gson.GsonConverterFactory
|
||||
|
||||
class MercuryApi(private val key: String, shouldLog: Boolean) {
|
||||
class MercuryApi(shouldLog: Boolean) {
|
||||
private val service: MercuryService
|
||||
|
||||
init {
|
||||
@ -26,7 +26,7 @@ class MercuryApi(private val key: String, shouldLog: Boolean) {
|
||||
val retrofit =
|
||||
Retrofit
|
||||
.Builder()
|
||||
.baseUrl("https://mercury.postlight.com")
|
||||
.baseUrl("https://www.amine-bou.fr")
|
||||
.client(client)
|
||||
.addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.build()
|
||||
@ -34,6 +34,6 @@ class MercuryApi(private val key: String, shouldLog: Boolean) {
|
||||
}
|
||||
|
||||
fun parseUrl(url: String): Call<ParsedContent> {
|
||||
return service.parseUrl(url, this.key)
|
||||
return service.parseUrl(url)
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,6 @@ import retrofit2.http.Header
|
||||
import retrofit2.http.Query
|
||||
|
||||
interface MercuryService {
|
||||
@GET("parser")
|
||||
fun parseUrl(@Query("url") url: String, @Header("x-api-key") key: String): Call<ParsedContent>
|
||||
@GET("parser.php")
|
||||
fun parseUrl(@Query("link") link: String): Call<ParsedContent>
|
||||
}
|
||||
|
@ -180,7 +180,6 @@ class ArticleFragment : Fragment() {
|
||||
) {
|
||||
rootView.progressBar.visibility = View.VISIBLE
|
||||
val parser = MercuryApi(
|
||||
BuildConfig.MERCURY_KEY,
|
||||
prefs.getBoolean("should_log_everything", false)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user