GithubHelp home page GithubHelp logo

jwiki's Introduction

Jwiki

Codacy Badge

Java tool to get wikipedia data

How to Use

First Download jar from here and import inside your project.

Example

 Jwiki jwiki = new Jwiki("elon musk"); 
 System.out.println("Title :"+jwiki.getDisplayTitle()); //get title
 System.out.println("Text : "+jwiki.getExtractText());  //get summary text
 System.out.println("Image : "+jwiki.getImageURL());    //get image URL

Thank You

Please ⭐️ this repo and share it with others

Contributing

If you want to contribute to this project and make it better with new ideas, your pull request is very welcomed. If you find any issue just put it in the repository issue section, thank you.

jwiki's People

Contributors

codacy-badger avatar viralvaghela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

doanvietcntt99

jwiki's Issues

Null Pointer Exception

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

Can You Add this project to Maven?

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.

issue on android word

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.