GithubHelp home page GithubHelp logo

Comments (12)

theflightguy2 avatar theflightguy2 commented on June 23, 2024 1

from hadith-api.

fawazahmed0 avatar fawazahmed0 commented on June 23, 2024

Walaikum salam, you need to implement the logic in python

first you need to generate a random number
then use that random number in this url format:
https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions/eng-abudawud/{randomnumber}.json

and then to get data from url, refer this example

from hadith-api.

theflightguy2 avatar theflightguy2 commented on June 23, 2024

Ah ok, Jzk Khair.

Does this API include Bukhari, Muslim, Sunan books etc? Or is it just riyadusalihin like sunnah.com?

from hadith-api.

fawazahmed0 avatar fawazahmed0 commented on June 23, 2024

Yes it includes those books.
Here is a demo website I created using this api:
Demo

Here are the list of available books :
https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions.json

from hadith-api.

theflightguy2 avatar theflightguy2 commented on June 23, 2024

Great news... can I just ask one more thing, this endpoint you just gave which book will it yield the hadith from? And is there any range of numbers from whioch we should generate the number#

Appreciate the help, May Allah SWT bless you as well.

from hadith-api.

fawazahmed0 avatar fawazahmed0 commented on June 23, 2024

For range, refer last_hadithnumber at this link:
https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/info.json

For sahih muslim english edition, use this:
https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions/eng-muslim/{randomnumber}.json
sahih muslim arabic edition
https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions/ara-muslim/{randomnumber}.json

For abu dawud english edition,
https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions/eng-abudawud/{randomnumber}.json

Refer https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions.json for all editions available

from hadith-api.

theflightguy2 avatar theflightguy2 commented on June 23, 2024

from hadith-api.

fawazahmed0 avatar fawazahmed0 commented on June 23, 2024

can you give me the link which is showing error?

from hadith-api.

theflightguy2 avatar theflightguy2 commented on June 23, 2024

from hadith-api.

fawazahmed0 avatar fawazahmed0 commented on June 23, 2024

You have to replace the {randomnumber} with the random number generated in python.
For example this link:
https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions/eng-muslim/{randomnumber}.json
may become
https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions/eng-muslim/77.json

I assume you are new to development, it's better if you take some python's beginners course, that should definitely help you in developing your application

from hadith-api.

theflightguy2 avatar theflightguy2 commented on June 23, 2024

from hadith-api.

fawazahmed0 avatar fawazahmed0 commented on June 23, 2024

oh ok! May Allah bless you for making hadith app 🙂

from hadith-api.

Related Issues (20)

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.