viralvaghela / jwiki Goto Github PK
View Code? Open in Web Editor NEWJava tool to get wikipedia data
Java tool to get wikipedia data
Hello,
I used your program and I liked it very much, it is very helpful and easy to extend and use.
When I was using your application I faced a problem, when you pass a parameter to constructor to search in Wikipedia and there is no information about that topic program will throw a null pointer exception. I just tried to solve it by adding an "if" condition before creating the "JSONObject" for retrieving the image and check if the "displayTitle" is not null then try to create the "JSONObject" and retrieve the image otherwise just give them a value like "information not found".
Now if I pass a parameter that it doesn't have any return value your code will not return a null pointer exception.
I just wanted to let you know, please check this issue and if what I did isn't correct or if it will cause a confliction in other parts, let me know.
Thank you
Hi @viralveghela I love this project and its really useful to me. But it will be if you add it to maven . then users can access it using maven without downloading them directly. Also can you Javadoc this so that there is a documentation.
java.lang.NullPointerException: Cannot invoke "org.json.simple.JSONObject.get(Object)" because "jsonObjectOriginalImage" is null
Title :Android
Text :
Image :
at com.wiki.Jwiki.getData(Jwiki.java:37)
at com.wiki.Jwiki.(Jwiki.java:19)
at com.wiki.WikipediaSample.main(WikipediaSample.java:6)
||
/
when i use "android" word i get null pointer error on image please fix or remove image part or do try catch block for all three seperately so that one fails you can give source not found like that.
and also i tried to execute your project without using jar whick i took from jwiki repo but it gives "noclassdefFound error: okio/Buffer". i dont know know what to do.
Exception in thread "main" java.lang.NoClassDefFoundError: okio/Buffer
at com.squareup.okhttp.HttpUrl.canonicalize(HttpUrl.java:1560)
at com.squareup.okhttp.HttpUrl$Builder.push(HttpUrl.java:1105)
at com.squareup.okhttp.HttpUrl$Builder.resolvePath(HttpUrl.java:1096)
at com.squareup.okhttp.HttpUrl$Builder.parse(HttpUrl.java:1055)
at com.squareup.okhttp.HttpUrl.parse(HttpUrl.java:596)
at com.squareup.okhttp.Request$Builder.url(Request.java:162)
at com.wiki.WikipediaSample.getData(WikipediaSample.java:32)
at com.wiki.WikipediaSample.(WikipediaSample.java:26)
at com.wiki.WikipediaSample.main(WikipediaSample.java:13)
Caused by: java.lang.ClassNotFoundException: okio.Buffer
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 9 more
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.