aztro icon indicating copy to clipboard operation
aztro copied to clipboard

Error: Request failed with status code 400

Open Lekhrajk opened this issue 2 years ago • 22 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

Lekhrajk avatar Mar 29 '23 10:03 Lekhrajk

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

nsstarr avatar Mar 29 '23 10:03 nsstarr

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

Lekhrajk avatar Mar 29 '23 10:03 Lekhrajk

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...

BotBuildersTech avatar Mar 29 '23 11:03 BotBuildersTech

Is there anyway to reach him out?

NoamN9 avatar Mar 29 '23 11:03 NoamN9

Is there anyway to reach him out?

check twitter and LinkedIn links in his profile

Lekhrajk avatar Mar 29 '23 11:03 Lekhrajk

Let's all send an email to this: [email protected] I have sent an email to him but he did not respond to it.

Lekhrajk avatar Mar 29 '23 12:03 Lekhrajk

api is down

Shubhamrawat5 avatar Mar 29 '23 15:03 Shubhamrawat5

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

iniciopublic avatar Mar 29 '23 19:03 iniciopublic

Is there any alternative to this API? .

Lekhrajk avatar Mar 30 '23 09:03 Lekhrajk

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.

Madbrad200 avatar Mar 30 '23 15:03 Madbrad200

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 avatar Mar 31 '23 09:03 PaulRosset

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

nsstarr avatar Mar 31 '23 10:03 nsstarr

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.

PaulRosset avatar Mar 31 '23 11:03 PaulRosset

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: [email protected]

jminutaglio avatar Mar 31 '23 22:03 jminutaglio

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."
}

jminutaglio avatar Apr 01 '23 15:04 jminutaglio

Does anyone know a similar alternative in Node.js?

nsstarr avatar Apr 02 '23 07:04 nsstarr

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.

leekuo avatar Apr 02 '23 09:04 leekuo

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.

Lekhrajk avatar Apr 02 '23 10:04 Lekhrajk

@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. :)

nsstarr avatar Apr 02 '23 10:04 nsstarr

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

jminutaglio avatar Apr 03 '23 15:04 jminutaglio

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

Flare26 avatar Sep 14 '23 15:09 Flare26