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

Additional characters being returned with the horoscope message #8

Open
mattchue opened this issue Feb 17, 2016 · 9 comments
Open

Additional characters being returned with the horoscope message #8

mattchue opened this issue Feb 17, 2016 · 9 comments

Comments

@mattchue
Copy link

Because this scrapes things from GaneshaSpeaks unofficially, I imagine this bug has been introduced by their doing.

The horoscope property of the result has an unnessicary [' before the actual horoscope content.

See this request. The extra characters can be seen at the beginning of the horoscope value.

{
  "date": "17-02-2016", 
  "horoscope": "[' The company of like-minded people will keep you in cheery spirit throughout the day. The day promises to be lively and vibrant as you will engage in one activity after another. But Ganesha warns that being over enthusiastic may be detrimental to your health. You energy level will be at an all-time high as you enjoy soaring to new heights in the company of loved ones.", 
  "sunsign": "scorpio"
}
@ghost
Copy link

ghost commented Mar 10, 2016

Any suggestions to solve this?

@zak123
Copy link

zak123 commented Mar 10, 2016

What I did to solve it was just edit my code locally, its in Objective-C but its really basic, just seeing if the string starts with "[" and deleting everything up to the first letter

-(NSString*)formatHoroscopeText:(NSString *)horoscopeText {

    if ([horoscopeText hasPrefix:@"["]) {
        NSString *newStr = [horoscopeText substringFromIndex:3];

        return newStr;
    } else {
        return horoscopeText;

    }


}

It's not a perm fix and if it ever has a new issue with some other character prefixing strings I'll have to update the code again but I'm sure someone else can find a better solution

@skined90
Copy link

Hi,

There are few issues with the API.
First, on request for some period, horoscope value starts with the " [' " character.
Second things is, on knowmore API call, weird json is returned:

{ "Type": "Air-Cardinal-Positive", "lord": "\\n']", "lucky_day": "['Venus : Blue, Green", "lucky_number": "6, 15, 24, 33, 42, 51", "meaning_of_name": "The Scales", "sanskrit_name": "Tula" }

Something is messed up.

@tapaswenipathak
Copy link
Owner

Are they still coming?

@StefanWerW
Copy link

@tapasweni-pathak Yes. If you try http://horoscope-api.herokuapp.com/horoscope/today/taurus , it returned:

{
"date": "02-06-2016",
"horoscope": "[' Ganesha urges you to be prepared for setbacks and disappointments today. Your efforts may end in being a waste of precious time and energy. The results you get are likely to be far below your expectations. Falling short of your target is likely to weigh you down with stress and anxiety. You can, however, ease and reduce your frustration by reexamining your expectations and lowering them down to a comfortable, achievable level.",
"sunsign": "taurus"
}

Still coming the [ char.

@KarthikaReddy
Copy link

{
"date": "26-08-2016"
"horoscope": "[' Most of your time will be spent at the work place. You will excel in all your tasks today. Professional relationships will be marked by co-operation. You will have cordial relations with your colleagues. It is an auspicious and progressive day for business, says Ganesha."
"sunsign": "Leo"
}

[ starting char

@angien
Copy link

angien commented Sep 7, 2016

:( Still doing it.

@kamalverma91
Copy link

Hello
Tapasweni

This link is not working showing error 404 not found .
http://horoscope-api.herokuapp.com/knowmore/libra

@adarrrshc
Copy link

any workaround for java?

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

9 participants