“Basically it’s a php based website, with a mysql backend. It’s been written from scratch by someone, who’s not documented it or even put it under version control. If you’re a good php programmer and are happy to wrangle someone else’s code, then you’re welcome to help out.”
I’d like to take a look at the code and see how much work it would require to get the site back up and the product data back online.
Great to hear from you and let’s get this back up.
First, some context: the site was set up by Phillipe Piagnol who then transferred it to Open Knowledge and specifically Open Knowledge Labs about a year ago.
Hi. I’ve been in touch with swmerrill and Matt Moore about this. I too am willing to offer any assistance I can to get this site back up and running. I come from more of a sys admin background than a coder, so perhaps that nicely compliments swmerrill’s skills.
@mike and @swmerrill this is great. Please take a look at the docs and see what makes sense and please raise any queries. I note I and colleagues may be away from keyboard for next few days so apologies if you don’t get a swift response and hope to get on getting you folks access to start poking around once I and/or colleagues i’m back on the internets end of this week!
I’ve had a quick look at the code. I think the best thing to do is to stick it on a webserver and see if we can get it to run. Matt mentioned that it’s available on one of the lab servers. Is it possible to get an account on this server to try setting it up? If not, is it possible to get a dump of the database, so that I can try running it on one of my test machines? Again, Matt mentioned that he thought that there was a copy of the database on the labs server.
@mike@swmerrill this is great and we will double-check with relevant sysadmins both about where current code is running and getting you somewhere on a Labs machine to play around.
I downloaded the 100 MB zip file from GitHub to look at the code and I browsed the other project files there, too. The code is poorly documented and I immediately ran into a small bug that kept it from running. There’s also some (probably) useless Python code connected to Django. But the main thing was that the database was not included. There are three large Excel files with manufacturer data but I would have expected a mysqldump file with the product, manufacturer, and other data that we could have used to rebuild a MySQL database.
Last night, I rediscovered a Google doc written by Philippe, the original developer, at okfn-labs list - Google Docs. It contains a link to a separate location for downloading the data. Clicking it takes you to some other OKFN site but not to the data.
Is there any way to get a copy of the data in order to see whether I can reconstruct the database? Or did the Labs put up a server with it so we can test the code and see what needs to be done?
Yes - not that well documented by its original author (who was not a coder i think)
Believe you are right that django code can be dumped
mysqldump won’t be in github but will be on the server
I believe it takes you to the broken product data website (what we are trying to fix).
Re getting the data (and the server), as we are getting into more proper sysadmin can I ask you to open an issue at: Issues · okfn/okfn.github.com · GitHub (that’s the best place for tracking this and its preferred location for labs sysadmins … - apologies for asking for a new thread though this can just be about getting the data dump)
The Home, Browse Data, Data Quality, Download Data, and Search links all point to locations (directories) that do NOT exist in the github version of the program (unless I’m missing something). We need to find the remainder of the code (for directories en, navigate, data-quality, download, and search) and add it.
ok, maybe as a first step we can just get you ssh access to actual server and you see if your simple patch fixes things there. that will at least get site back up and we can then work on everything else.
A couple of notes while we’re waiting for Daniel’s return.
The table with the gtin’s (global trade item numbers, aka barcode numbers) is gtin. The barcodes or gtin’s themselves are in a field called gtin_cd and the descriptions or product names are in a field called gtin_nm. So a simple SQL query such as “SELECT gtin_cd, gtin_nm FROM gtin;” will pull out all 921805 entries. (Best, of course, to include a LIMIT or WHERE clause. :))
Was there a plan in place to update the data as new gtin’s are issued? I wonder how the original entries were collected. Does the OFKN have a GEPIR account with GS1? (This is not urgent, but I can’t help wondering how long the database will be useful if we don’t or cannot update more than 20 or 30 entries a day, so I thought I’d raise the issue.)
OK, back online. The target server needs a little attention today, after which I can begin prepping it to host http://product-open-data.com/ properly (it had never actually been running on this server).
@swmerrill if you would like access to the server, you can email the general OKFN sysadmins (sysadmin@okfn.org) for access referencing this page/issue and requesting membership in the labs_dev group. Of course, I’m quite happy to do the configuration work to get your working code up. At any rate, perhaps the next step is to push your local changes to GitHub so we can pull down the working code to the production server.
OK, having solved some of the more pressing issues on the server, I was able to install the prereqs for the site and boot it back up. Have a look: http://product-open-data.com/
Congratulations, Dan! The site looks good. I haven’t tried all the download links, yet, but the ones I clicked worked well.
We could stand to make it even more clear that codes need to be 13 characters long in all cases or else modify the code to accept shorter ones. Also, the data need to be updated. But the site appears to be back to where it was at the end of 2013.
There is an issue with the Android (and possibly the iOS) app. It gives the error message “Sorry, this GTIN code is not in the database” regardless of what code is entered or scanned, including those that are found when using a browser. The app appears to prepend a zero to GTIN’s that are only 12 characters long so that is likely not the problem.