vdemay / scoopit-java Goto Github PK
View Code? Open in Web Editor NEWA java Framework to use Scoop.it API
License: Apache License 2.0
A java Framework to use Scoop.it API
License: Apache License 2.0
Hello,
I just discovered your app, and I find it wonderful. This job will help me a lot.
I just have on question. In your sample code every posts from the topic are returned. For my work i would like to add the plain text of the post and the normal image url. How could I add those informations ? If I have all those informations it would be so great for me.
Thanks in advance,
Regards
Matthieu526
PS : and what about a list of tags for each post ?
Edit 29-01-14 : i found what I wanted, and understood a little better how your work workes.
Hello,
What is the best way to retrieve every posts from a topic ? When a topic is asked the number of posts is returned, but how many are there by page ? Is'nt it possible to know how many pages there are ? So I don't know what is the best method.
Thanks in advance for your answers,
Matthieu526
(or some another Maven public repository)
Hello,
I wrote a function to use api's resolve function. I use it to resolve topics. But some times topics doesn't exist and I would like that my app don't crash. This works perfectly for topics who exists.
I wrote the function using exactly your model :
public Long getIdFromShortName(String shortName) throws ScoopApiExecutionException {
return getIdFromShortName(shortName, null);
}
public Long getIdFromShortName(String shortName, String type) throws ScoopApiExecutionException {
Multimap<String, String> params = LinkedListMultimap.create();
if (type != null) {
params.put("type", type.toString());
} else {
params.put("type", "Topic");
}
params.put("shortName", shortName);
JsonNode root = doGet(RESOLVER_ENDPOINT, params);
if (root == null) {
return null;
}
Resolver model;
try {
model = mapper.readValue(root, Resolver.class);
} catch (JsonParseException e) {
e.printStackTrace();
return null;
} catch (JsonMappingException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}
return model.id;
}
What should I add to return for exemple "0" if the topic doesn't exists ?
Thanks in advance,
Matthieu526
Hello,
When I use your program, and try to change the ID of the topic to retrieve, the program crashes.But I can't understand why... The error is a "NullPointerExeption" at line :
for (Post p : t.curatedPosts).
And at the end it sends back to this line :
mapper.readValue(root.get("topic"), Topic.class).
I don't know what to do to resolve this error.
Regards,
Matthieu526
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.