What Ping Pong is and It Exists
Ping Pong is a module in PyAdmin that identifies bad links on our website and lets you correct them. It doesn't identify bad Vote Smart links; it identifies bad links that we have on our site, such as a campaign site that no longer exists, for example. The purpose of Ping Pong is for users to be able to easily replace bad links with good ones.How to use Ping Pong
This is how to use Ping Pong. Just kidding. In the Ping Pong module, you can filter the errors you see by a) where the error is found in the database and b) what type of error it is (status). So, for example you can see all of the office_webaddress 400 errors if that's what you're looking for. As you can see, each error status is coded. Here is a list of translations. Ping Pong allows you to edit the link directly from the module rather than having to go find it in admin and edit it yourself.Ping Pong doesn't do a very good job of telling the user where the error exists in the database which makes it hard to know what link you should be looking for, so even if you can see that a link is bad, you may have to use other tools to determine where to find the right link. So, for example, Ping Pong flags this link for me as a "Congress" "404" error. I can follow that link to verify that it's bad. But how do I find the correct link to replace it with? Good question - I can think of three good ways:
- Sometimes you can tell what the page is meant to display from the URL text or the information on the error page. With the example I just used, I can do that. The link takes me to the Connecticut House Democrats website. By searching around, I can see that O'Connor is no longer in the state leg. I therefore know that I cannot replace this link with a good one. Case closed.
- You can find out more information using SQL. In the example I used above, I can see in Ping Pong that the relevant link is found in the webaddress column of the office_webaddress table, so I can write a query to find out who this person is and check his/her admin page, find the link, and determine what the right link should be. I used the following query for this example:
from office_webaddress ow
join office_candidate oc on (ow.office_candidate_id = oc.office_candidate_id)
join candidate c on (c.candidate_id = oc.candidate_id)
where webaddress = 'http://www.housedems.ct.gov/OConnor/'
- You can also use The Wayback Machine to see what the page looked like when the link was working, which will inform you as to what link you should be looking to replace the bad one with. The Wayback Machine is a tool that lets users sear for links to see what content has been on those pages historically. See the history of the Vote Smart homepage as an example (this is really cool). In this example, The Wayback Machine gives me great results. Looking at the most recent snapshot they have, I can see that this link used to be O'Connor's page on the House Democrats page. If he were still in office, I would go find the correct link to this page and replace the bad link in Ping Pong with the new, correct link.
The Quirks of Ping Pong
- Ping Pong doesn't always just return link errors, even though that's all it's supposed to do. The following "DB Tables" don't return link errors - I suggest not using them for now: congofficialtitle, congtext, congofficialsynopsis, candidate, contact_candidate, and biotext.
- While searching in some "DB Table"s, you may see some errors that are links and some that are not. Try filtering by 404 and 500 errors. With some tables, this will help you filter so that you're just looking at link errors.