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

Detect redirects (Cumulative Facebook shares) #17

Open
riceissa opened this issue Oct 31, 2016 · 0 comments
Open

Detect redirects (Cumulative Facebook shares) #17

riceissa opened this issue Oct 31, 2016 · 0 comments

Comments

@riceissa
Copy link
Collaborator

When submitting "Cumulative Facebook shares", the numbers for redirects are the same as those of the destination pages because Facebook merges redirects with the actual articles. This is confusing unless you can tell that a page is a redirect.

For instance submit the following pages:

Quora
Timeline of Quora

at http://wikipediaviews.org/multiplemonths.php (I would post a link but Wikipedia Views can't do this currently).

Notice that the "Cumulative Facebook shares" are the same because the timeline page redirects to the main page.

I would suggest coloring redirects in rgb(255, 137, 33) (#FF8921), which is the color Wikipedia uses in the "Display links to disambiguation pages in orange" gadget.

Redirects can be detected using the MediaWiki API. Compare https://en.wikipedia.org/w/api.php?action=query&titles=Timeline%20of%20Quora&redirects&format=jsonfm

{
    "batchcomplete": "",
    "query": {
        "redirects": [
            {
                "from": "Timeline of Quora",
                "to": "Quora",
                "tofragment": "Timeline"
            }
        ],
        "pages": {
            "26749224": {
                "pageid": 26749224,
                "ns": 0,
                "title": "Quora"
            }
        }
    }
}

with https://en.wikipedia.org/w/api.php?action=query&titles=Quora&redirects&format=jsonfm:

{
    "batchcomplete": "",
    "query": {
        "pages": {
            "26749224": {
                "pageid": 26749224,
                "ns": 0,
                "title": "Quora"
            }
        }
    }
}

See https://www.mediawiki.org/wiki/API:Query#Resolving_redirects for more.

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