This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

How to get Blogspot post label by API?  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have 4 classes which working fine but when i try change TO GET POST BY LABELS by using this example How to get blog posts by label in blogger api I got error but my GOOGLE API KEY working fine.











When i change Webservice.java code @GET("posts") to @GET(" https://www.googleapis.com/blogger/v3/blogs/2331406457493300588/posts?labels=firmware&key=") working fine but not return with Lables
 
Saloon Keeper
Posts: 5344
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

I got error


What error? TellTheDetails
 
Joel Manumbu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
return with errors networking: Not Found  

Where that error created on Class PostRepository.Java with the following code <pre>package com.manupearls.unity.data.repository;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.util.Log;

import com.manupearls.unity.data.models.Manupost;
import com.manupearls.unity.data.network.Webservice;
import com.manupearls.unity.ui.helpers.Constants;

import java.io.IOException;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;


public class PostRepository {
   private final Webservice webservice;

   public PostRepository(Webservice webservice) {
       this.webservice = webservice;
   }

   public LiveData<Manupost> getPosts( String token) {
       final MutableLiveData<Manupost> data = new MutableLiveData<>();
       webservice.getPosts(Constants.BLOGGER_KEY,token).enqueue(new Callback<Manupost>() {




           @Override
           public void onResponse(Call<Manupost> call, Response<Manupost> response) {
               if (response.isSuccessful()){
                   data.setValue(response.body());
               }else{
                   try {
                       Log.d("errors networking", response.errorBody().string());
                   } catch (IOException e) {
                       e.printStackTrace();
                   }
               }
           }

           @Override
           public void onFailure(Call<Manupost> call, Throwable t) {
               Log.d("error networking", t.getMessage());
           }





       });

       return data;
   }

}
</pre>



 
Tim Moores
Saloon Keeper
Posts: 5344
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the future, when posting code of any length, please UseCodeTags (<-- this is a link). Without them, code is hardly unreadable.

So in which line of code does that happen? What specifically is failing?
 
Joel Manumbu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks mr



my url for labels post is
https://www.googleapis.com/blogger/v3/blogs/2331406457493300588/posts?labels=firmware&key=AIzaSyDWnOxt9WbsytU7mIgNJ-EIXyzhgZn3Xt8
 
Joel Manumbu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The error comes in line number 39
 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!