sameerkumar18 / aztro

The Astrology API đź’« Get daily horoscope!

Home Page:https://aztro.sameerkumar.website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Request failed with status code 400

Lekhrajk opened this issue · comments

Getting this error again and again
Exact error : "message": "'NoneType' object has no attribute 'text'"
Status : 400
Could you please tell me how to resolve or what is the issue

Hey @Lekhrajk, I have the same error. Looking for ways to resolve the issue.

Hey @Lekhrajk, I have the same error. Looking for ways to resolve the issue.

I think there is something changed in the backend. Please let me know if find any solution

yes, even I am getting this error 400 from 29th March 2023.
It was working fine until 28th March.
Hopefully this gets fixed by Sameer asap...

commented

Is there anyway to reach him out?

Is there anyway to reach him out?

check twitter and LinkedIn links in his profile

Let's all send an email to this: sam@sameerkumar.website
I have sent an email to him but he did not respond to it.

api is down

since when does it not work? the same happens to me

Is there any alternative to this API? .

Hi, I made an issue on the PyAztro page.

The issue is that the source for the code, http://astrology.kudosmedia.net/ , appears to have died. Unless the website comes back up, Aztro is also not going to work.

The code would need to be completely rewritten to use another source, if such a source exists.

For those who need an alternative, here is a code that works to retrieve horoscope:

from bs4 import BeautifulSoup
import requests

signs = {
    "aries": 1,
    "taurus": 2,
    "gemini": 3,
    "cancer": 4,
    "leo": 5,
    "virgo": 6,
    "libra": 7,
    "scorpio": 8,
    "sagittarius": 9,
    "capricorn": 10,
    "aquarius": 11,
    "pisces": 12,
}

given_sign = "aries"

URL = "https://www.horoscope.com/us/horoscopes/general/horoscope-general-daily-today.aspx?sign=" + \
    str(signs[given_sign])

r = requests.get(URL)
soup = BeautifulSoup(r.text, 'html.parser')

container = soup.find("p")

print(container.text.strip())

@PaulRosset Could you give some details on how this code works?

It bascically go on horoscope.com website and retrieve horoscope text posted there.
It uses requests Python library to perform the http call and beautifulsoup library to parse and deal with the html.
You just need to provide which sign you want to retrieve.

We built a replacement - same output

    Compatibility
    Lucky Number
    Lucky Time
    Color
    Date Range
    Mood
    Description

Ex horoscope:

Saturday, April 1st, 2023 (Moon in Leo): Scorpio, today you may feel a need for self-expression and creativity. You may want to showcase your unique talents and abilities. Use this energy to express yourself authentically and confidently. Some past events that occurred on this day include the founding of the city of Baghdad by the Abbasid caliph Al-Mansur. This event could be relevant to Scorpios as they may be seeking to establish a new cultural or intellectual center in their own lives.

We'd consider opening the service up to others. Not $0 but relatively low to what others are charging. But you'd have a usage license to the horoscopes vs. taking a risk on using other's work.

Contact if interested:
partnerships@twinflamedev.com

quick update -> we have a preview of the API that we can let you try. Email us and we'll give a token.

In general, the mods to your app if you were using Aztro should be lightweight:
post: https://us-central1-tf-natal.cloudfunctions.net/horoscopeapi_test?token=<token>&sign=<sign>&day=<day>

Same basic call but:

  • adds an auth token
  • day is a date in MM-DD-YYYY format; ex 04-01-2023

Response is similar:

{

  "current_date": "04-01-2023",
  "compatibility": "Scorpio",
  "lucky_time": "15:30",
  "lucky_number": "61",
  "mood": "Relaxed",
  "description": "Saturday, April 1st, 2023 (Moon in Leo): Scorpio, today you may feel a need for self-expression and creativity. You may want to showcase your unique talents and abilities. Use this energy to express yourself authentically and confidently. Some past events that occurred on this day include the founding of the city of Baghdad by the Abbasid caliph Al-Mansur. This event could be relevant to Scorpios as they may be seeking to establish a new cultural or intellectual center in their own lives."
}

Does anyone know a similar alternative in Node.js?

commented

Gee that's interesting, it's going to be hard for Sameer to fix as this code has been scraping my website for years without me knowing and I've been paying $$$ to AWS for database and hosting fees. Unfortunately, I am not going to be bringing the website back as a free resource to be scraped anymore.

Gee that's interesting, it's going to be hard for Sameer to fix as this code has been scraping my website for years without me knowing and I've been paying $$$ to AWS for database and hosting fees. Unfortunately, I am not going to be bringing the website back as a free resource to be scraped anymore.

ohh! you are the original owner. Sorry about it.
Yes, this is wrong but many of us were using it considering it is open to all.
But now I have removed all the code. Created my custom API for it and set DB for it.

@leekuo I didn't realise this was happening to your website but, if you won’t consider a free tier for the open-source community, who clearly rely on your source, rather than shut it down, perhaps a minimal charge could be introduced?
This way we could assist in your AWS hosting fees & keep it open.
I'd certainly support it. :)

More info regarding our alternative here, open source API codeline if you want to build your own; hosted/subscription if you want to use our content:

TwinFlame Horoscope API

commented

Gee that's interesting, it's going to be hard for Sameer to fix as this code has been scraping my website for years without me knowing and I've been paying $$$ to AWS for database and hosting fees. Unfortunately, I am not going to be bringing the website back as a free resource to be scraped anymore.

Same here I'd pay to use the database because the pyaztro library is so easy to use and it'd be super fun to integrate into my discord bot