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

API for tags has issues #923

Open
RamRS opened this issue Mar 23, 2023 · 0 comments
Open

API for tags has issues #923

RamRS opened this issue Mar 23, 2023 · 0 comments

Comments

@RamRS
Copy link

RamRS commented Mar 23, 2023

I see two issues with the API for tags. One is minor/cosmetic and the other seems to be major.

MINOR: Documentation on API page is problematic:

API page screenshot

See the code segment under "Given" (the URL to the right). It shows a localhost URL which should be changed to https://www.biostars.org/api.... Also, the path to the tags.txt file specified is on Natay's Desktop, which should be masked/redacted. Third, the API doc says there's a parameter called months but the code block shows trange, not months. Fourth, showing the contents of tags.txt might be helpful.

MAJOR: The tags API does not work as advertised. The months parameter is useless and the trange parameter shown doesn't seem to acknowledge any value either. See demo below:

$ cat tags.txt
bash
R

$ curl -X POST -F "tags=@${PWD}/tags.txt" https://www.biostars.org/api/tags/list/\?trange=year
{
    "bash": {
        "answer_count": 61,
        "comment_count": 75,
        "total": 91
    },
    "r": {
        "answer_count": 502,
        "comment_count": 678,
        "total": 926
    }
}

$ curl -X POST -F "tags=@${PWD}/tags.txt" https://www.biostars.org/api/tags/list/\?months=1
{
    "bash": {
        "answer_count": 61,
        "comment_count": 75,
        "total": 91
    },
    "r": {
        "answer_count": 502,
        "comment_count": 678,
        "total": 926
    }
}

$ curl -X POST -F "tags=@${PWD}/tags.txt" https://www.biostars.org/api/tags/list/\?trange=day
{
    "bash": {
        "answer_count": 61,
        "comment_count": 75,
        "total": 91
    },
    "r": {
        "answer_count": 502,
        "comment_count": 678,
        "total": 926
    }
}

$ curl -X POST -F "tags=@${PWD}/tags.txt" https://www.biostars.org/api/tags/list/\?trange=month
{
    "bash": {
        "answer_count": 61,
        "comment_count": 75,
        "total": 91
    },
    "r": {
        "answer_count": 502,
        "comment_count": 678,
        "total": 926
    }
}

The counts do not change, so the parameter is either not checked or not used.

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

1 participant