Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Request failed with status code 400 #42

Open
Lekhrajk opened this issue Mar 29, 2023 · 21 comments
Open

Error: Request failed with status code 400 #42

Lekhrajk opened this issue Mar 29, 2023 · 21 comments

Comments

@Lekhrajk
Copy link

Lekhrajk commented Mar 29, 2023

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

@nsstarr
Copy link

nsstarr commented Mar 29, 2023

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

@Lekhrajk
Copy link
Author

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

@BotBuildersTech
Copy link

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

@NoamN9
Copy link

NoamN9 commented Mar 29, 2023

Is there anyway to reach him out?

@Lekhrajk
Copy link
Author

Is there anyway to reach him out?

check twitter and LinkedIn links in his profile

@Lekhrajk
Copy link
Author

Lekhrajk commented Mar 29, 2023

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

@Shubhamrawat5
Copy link

api is down

@iniciopublic
Copy link

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

@Lekhrajk
Copy link
Author

Is there any alternative to this API? .

@Madbrad200
Copy link

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.

@PaulRosset
Copy link

PaulRosset commented Mar 31, 2023

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())

@nsstarr
Copy link

nsstarr commented Mar 31, 2023

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

@PaulRosset
Copy link

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.

@jminutaglio
Copy link

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
Copy link

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

@nsstarr
Copy link

nsstarr commented Apr 2, 2023

Does anyone know a similar alternative in Node.js?

@leekuo
Copy link

leekuo commented Apr 2, 2023

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.

@Lekhrajk
Copy link
Author

Lekhrajk commented Apr 2, 2023

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.

@nsstarr
Copy link

nsstarr commented Apr 2, 2023

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

@jminutaglio
Copy link

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

@Flare26
Copy link

Flare26 commented Sep 14, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests