BookAdder: InstallationBut First!Please be sure you have read the preceding BookAdder docfile About BookAdder for an overview before you plunge into these procedures. It only takes a moment or two, and leaves you better equipped to understand what you're doing and why. Please: RTFM! The Very Easy InstructionsFirst PreparationsYou will, of course, already have unzipped the ZIPfile in which BookAdder comes (or you wouldn't be reading this). Ideally, you will have made a separate subdirectory on your local computer for these files, so they don't get mixed up with anything else (perhaps named BookAdder. If that should not be the case, I strongly recommend you stop here and now and make such a separate subdirectory, then move all the BookAdder files into it--then come back to here. Next, you need to make a directory on the computer hosting your site. I recommend you place it just off your site's root (main) directory. If those terms confuse you, your "root" directory is the directory containing the page your visitors would come to by just entering your site's basic URL into their browsers; say I entered http://seo-toys.com in my browser--the directory containing the page you see there is in my site's "root" directory. BookAdder should work properly no matter where placed on your site, but you really should give it a subdirectory of its own, and there's no special reason to go any farther down from your root than just under it. If, however, you have multiple "sub-domains", then the logical place to put each one's BookAdder subdirectory is just below that sub-domain's chief directory (which may be a couple of levels below the true domain root); no problems, BookAdder just works wherever it is. (I cannot tell you how to use your ftp software to work with files on your host--there is altogether too much variation in products. I can only tell you what you need to do. If you have trouble with this, perhaps--because using ftp software is a rather basic webmaster skill--you should obtain help from a professional in maintaining your site. Select a name for your BookAdder directory. Use good SEO principles, and select a name that tells the search robots something about the directory contents: something like red-cats-book-shop is better than something like books. (Use hyphens, not underscores, to separate words in file and directory names.) Create the directory. Then, if you are hosted on a Unix-based host system, set that new directory's "permissions" to either 777 or rwxrwxrwx (those are simply two different ways of specifying the same thing--some displays show permissions one way, some the other). If those terms seem "magical" to you, read the BookAdder docfile on Security-Related Concerns, which explains the basics of "permissions". The chances are that simply creating the new subdirectory will leave it permissioned at 755 (which is rwxr-xr-x); if so (and that varies from host to host, but 755 is common), you will need to explicitly change the permissions to 777. If you don't do this, there's a good chance that BookAdder will be unable to install. If you have the misfortune to be hosted on a server running on one or another Windows operating system, "permissions" in this sense don't exist. The directory will be as "permissioned" as it gets just by being created, so don't try to "permission" it at all. Now that you have a home on your host for the BookAdder files, simply upload them to it--all of them. (Do be sure to keep the originals on your local system as an emergency backup if anything ever corrupts the "live" ones on your host; that's wildly unlikely, but paranoics live longer.) Verifying UsabilityPresumably you know this, but to be sure I'll say it here once for all: You "run" a PHP script by simply loading it into your browser like any web page. PHP is a "scripting language". When your host receives a request for an ordinary web page, as indicated by an extension of .html or .htm or .shtml (or whatever else it's been set up to recognize as specifying HTML pages), it just fetches the file and delivers it over the internet to your browser. But when you request a page with a .php extension (or, again, whatever the server has been told specifies a PHP script), it fetches the file but first runs it through the PHP processor, which can do many things, including generate output lines; the server then takes the output from the PHP processor and sends that back to your browser. Typically, a .php page will contain a mix of PHP script instructions and normal HTML (internally marked so the PHP processor knows which lines are what), though a "PHP script" could be 100% plain, ordinary HTML--or have zero plain HTML. In that way, a PHP script can make a "dynamic" web page by constructing the page "on the fly" based on many changing things: what parameters your browser supplied in its call, the contents of certain local files (like, say, an inventory list), or even the time of day. That's how, for example, one BookAdder script can be the "front door" for six different national bookshops: it "knows" which shop it's supposed to be from a parameter supplied in the call, and serves the corresponding version of itself. Your first step, once the BookAdder files have all been uploaded, is to run the script appropriately named tryme1st.php The URL will depend on what you named your new directory and where you placed it, but if we assume that your website is www.friends-of-red-cats.com and that you named the new directory red-cats-book-shop and that you placed it right off your root directory, you'd run the script by entering this into your browser's URL bar: http://www.friends-of-red-cats.com/red-cats-book-shop/tryme1st.php In the best (and most common) of cases, its output will look something like this, depending in part on your browser's window size and font settings (and with, of course, your site's data showing instead):
In some cases, that display may also contain (just below the top headline) a message box that looks something like this:
That's pretty much self-explanatory, but there's a little more about it in the BookAdder docfile on Security-Related Concerns. The caution is just that: a caution--it does not mean that BookAdder will not work for you. But you should speak to your host about the matter. If you got the OK screen, with or without the caution just described, and you have verified that all the data shown are correct, you may now proceed with installation. But, if either you got that screen but one or more of the data were wrong, or if you got an error message (with or without the warning just described), then you need to move to the docfile explaining those errors and what--if anything--you can do to cure the associated problem: click here for the BookAdder docfile Installation Problems. You can verify the path on your server by what your ftp program shows, but be aware that Unix-based servers--and the majority are--have something called "symbolic links" that allows files and directories to have an "alias"; thus, the path you see in your ftp software may seem to differ from the one being reported on-screen and yet be the same. If they do not look identical, simply use your ftp software to try to reach the directory just as shown on screen. Typical differences might look like this: Since you're still reading, presumably you got no fatal-error messages and verified that the reported data are all correct. Excellent--now onwards. Pre-Install CustomizationYou do this by using a plain text editor (not a word processor or HTML editor) to edit the BookAdder file cleverly named customize.php. In point of fact, that file is internally so heavily annotated that it is really self-explanatory, but let's go over it together anyway--measure twice, cut once, as the old carpenters say. The very top of the file looks like this:
Below that are six entry areas separated off by rows of asterisks. The first looks like this:
In all cases, the datum (or data) are the values beginning with a $ dollar sign and located on a line not started by // dual slashes. In this case, the datum is $myname, and you just change the sample entry--The SEO Tools, Toys, and Packages Site--to whatever you want, heeding the caution about marking any apostrophes and the advice about where and how to force long names to line-split when in larger type sizes. The next data area down is just a hair more complicated, in that it has two sub-parts; it looks like this:
Exactly because you are not yet ready to tune your search, I urgently suggest that for the moment you leave these two data just as they are set: they will make a nice, simple test case to see if everything is working, after which you can return to setting your own actual phrases. The next data area is a short and simple one:
You don't have to change this datum, now or ever. But it is wise to follow basic SEO principles and give your "front door" a meaningful name to help the searchbots in determining what your pages are focussed on. In the silly little example we have been using, you might call that page red-cats-book-shop.php. Don't "keyword stuff" the title, but do make it legitimately meaningful: use the same principles you would in naming it for human reading. Don't be afraid to give it the same name as the directory itself--in fact, that's probably a good choice. The installer will use whatever name it finds here--book-shop.php or what you set instead--as the name of a simple little file it makes at install time, and which file just points on to the real bookshop page, which is always realshop.php). The next data area down is even shorter and simpler:
This is worth a comment. If you already have a favicon image file, just put its full URL in here. But if you don't (and leave the entry blank), you are missing a small but neat way to make your site a little more professional and memorable. A favicon is that little icon image that you see for many sites up in your browser's URL bar, just before the actual site URL. Your having a simple, distinctive favicon image helps your visitors remember and feel comfortable with your site--it's a small thing, but successes are built of many small things done right. Use your favorite search engine to seek out information on how to make and use a favicon file (you use it by calling it in the <head> area of your HTML pages. My only advice is the classic KISS (keep it simple, stupid). The images are very small, so keep yours clean and simple and easily grasped. The last two data areas are for your Amazon and Abebooks associate ID codes. In the Amazon case, shown below, you can enter a code for any or all of the six national Amazon divisions; remember again that each division issues its own distinctive code--you cannot use one division's code at another. (Well, you probably can, but you wouldn't get paid for any sales!) Here is that entry area:
Be sure to get clear what you need to enter. You do not enter your "Access Key ID" or "Subscription ID"; you enter your associate ID, which typically looks something vaguely like redcats-20. The IDs, on the other hand, are long strings of nonsense letters and numbers jumbled together. You don't have to have any Amazon associations at all to actually start and run BookAdder, and you can insert individual divisional associate IDs as you get them: each will take effect immediately on your uploading of the revised customize.php file. The last data area is the Abebooks one. There are now five Abebooks national divisions, and there are data-entry zones for each, but be advised: right now, only the main (US) Abebooks ID matters or is used. The others are there for future use. (It is my impression that the main operation lists virtually everything the others do anyway, plus you and your visitors can customize the results to select booksellers anywhere in the world, for delivery anywhere in the world, with prices in virtually any existing currency--so there's little or no loss. The entry area looks like this:
I repeat: that second set is not functional yet. You can enter the IDs, if you have any, but only the main Abebooks interface will be used, and only the PID entered at Step 6a will be used there. Now, as the last lines of the file say:
(There is quite a bit more customizing that you can do, but we'll return to that after we have you up and running; this has just covered all the critical basic customizing necessary to run at all.) Actual InstallationNote: if you are using, or ever used, any earlier version of this software, you should edit your robots.txt file to remove all exclusions specific to that package; you can spot them by the directory name in their path, that being whatever directory you were previously using for the software. Before anything else, re-upload the newly modified copy of customize.php you just finished with. (Note that there is a backup copy of it, in case you ever screw anything up or otherwise want or need to re-start from scratch.) If you needed to re-permission the other files after upload (because of a problem detected running tryme1st), don't forget to re-permission this new upload, too. Next, run the PHP script named finstall.php. Its output messages are color-coded: green for ok, grey for non-action notices, yellow for "note this", and red for problem warnings. Ideally, the display will look like this:
You can re-run finstall.php at any time, as many times as you like. It will know what has already been done and will behave nicely. If you do, though, take note that some of the messages will change, and will be in grey or yellow instead of green, since the installer is notifying you of what is, not what it has done. For example, this would be typical after the file roll call (the display is slightly shrunken down here to fit better):
Now you're ready for a trial run. (If you got through tryme1st.php without any problems showing, nothing should have gone wrong here; but if you did get a red warning message, e-mail me and we'll work it out for you.) Doing a First RunThis is simple: load the file doall.php?test=y. With that attached test=y parameter, you'll be able to see its work as it progresses. The first thing you should see is the currency-exchange rates (as against the U.S. dollar) for the five non-U.S. Amazon divisions' national currencies, something that doall.php fetches (or freshens) every time it's called. That would be this:
Then it will begin the actual searching, going division by division. That, for Amazon U.S. (Amazon.com) begins something like this:
That header tells you the division it's doing (Amazon.com, the U.S. Amazon), what "keyword" phrase it's searching with (spokane), how many pages of results there are to get (12, though that may vary, depending on Amazon's stock), and that it's actually begun. (Were it picking up an interrupted search, it would say CONTINUING inseatd of BEGUN, and the number would be the number of pages left to get, not the total available).
The various right-arrow (») and dot (·) symbols tell you which script is actually sending the text: the » means doall.php is saying it, but any dots following mean, first dot, dofind.php (which is the "slave" that doall starts) is sending, and a second dot means, in turn, that findbooks.php, the secondary "slave" run by dofind, is the source. To clarify: »this is from doall.php»·this is from dofind.php, as relayed through doall.php »··this is from findbooks.php, as relayed through dofind.php then doall.php Most messages originate with findbooks, because it's the workhorse actually doing the job. Only when the job is completed (or interrupted in some way) do the intermediaries have anything to report to you. You may, at this point be wondering about the complexity of the task, and of the sequence of master-slave processes involved. This pattern evolved out of numerous bitter experiences with the limitations of various host servers when running jobs that take some time to complete, or use up some chunk of memory, or both. All too often, such processes, of which these runs are examples, just mysteriously and more or less randomly "die" mid-operation. Exact reasons are hard to determine, even from the best of hosts; the fails are irregular and not repeatable. To try to minimize problems, the scheme you have just seen evolved. The thing starts with doall, which organizes the six separate divisional searches. For each such search in turn, it starts a copy of the dofind script, which is the active controller; it monitors output from dofind, which issues (and relays) progress reports, but if dofind dies before it has completed its task, doall simply re-starts it (that cycle can go for up to five attempts before it gives it all up as a bad job). Meanwhile, dofind starts the real worker script, findbooks.php, which reports back page by page as it progresses through the search. If findbooks dies, dofind restarts it, but only from where it had gotten to (hence the INDEX # parameter you'll see below), not from the beginning, so the work that had been done is not lost and does not have to be pointlessly re-done. And so it goes . . . . Now here's a sample of how the reporting continues while findbook is getting data pages from Amazon. This trial task was deliberately set to produce a rather small amount of results, so it can finish up in a few seconds while you watch.
"Yesterday's count" is zero because there wasn't any run yesterday: this is the first ever. BookAdder has a safety feature such that if today's count is ever less than 80% of yesterday's, it assumes something went wrong and leaves yesterday's data in place; that way, you won't ever get a failed search largely or wholly wiping out your bookshop pages. If that safety is not tripped, BookAdder proceeds to further process the downloaded data and make the 27 individual drop-in blocks for the bookshop's listing pages (remember that we are stil just doing the first of six divisions). The messages will look like this (where "@" signifies the non-alpabetical characters block):
Note that if an alpha block had no titles, the messages will so inform you. We see that here with this limited sample, but you ought never to see that in a real run, except perhaps for letters like "X". Note that after making the 27 blocks for Amazon U.S., BookAdder also produces the all-in-one text file allbooks.us.gz, which is in "gzipped" format--it's compressed, but almost all browsers can read it direct (unlike a standard ZIP file), because modern browsers "know" the gzip algorithm. After making everything needed, the scripts report their success and conclusion of their operations, like so:
The seemingly duplicate success reports are in fact first from findbooks then separately from doall (dofind doesn't bother). Next, below the horizontal ruler, the process will begin anew at the next Amazon division in the sequence, which will be Amazon U.K. It will all look just about like the U.S. divisional run, save with the name changed, as in this snippet from the start:
So it will go, through all six divisions. There is no special final signoff message after the last division (Japan); the horizontal rule appears, and that's all she wrote. Checking Your First Run's LogObviously you are not going to sit at a screen watching data fetches for one to two hours daily. Normally, the nightly run will take place automatically and out of your sight (we'll get later on to how to set up such automated runs). But you can always see what's happening or what happened by looking at the BookAdder log file, which is a simple plain-text file. That file is named simply Shop.Log, and will be found in the logs subdirectory the installer put in the BookAdder directory you made at the outset. You can view it on line with your ftp software, or even your browser, or download it and look at it with any text editor. A typical run record would start with a line like this:
Following those will be a blank line, then a block of lines for the search of the first of Amazon's national divisions, the U.S. one. That block will look something like this (except that these lines are so long that they will probably break in your browser's display of this docfile, so I've put blank separator lines in between the real ones, though there are no such blank lines in the actual logfile) :
You should be able to see the procession clearly enough: doall starts its "slave" process dofind.php, with the "us" divisional parameter supplied; dofind then tells us that it will indeed start up a search in the us division, which it does by invoking its slave process, findbooks.php, which does the actual grunt work. Then findbooks tells us it is indeed starting, and from the beginning ("Index #1").
Ideally, findbooks simply trudges through its task, taking several minutes (depending on how many titles it's looking for), and finally completes satisfactorily, telling us so on the next line. Following its completion, it expires and its "master", dofind then also reports its success. It, in turn, expires, and finally doall acknowledges the divisional-task completions with a couple of message lines of its own, and the U.S. division task is completed. And so it should go through the whole set of six divisions. Checking Your First Run's ResultsNow the moment you've awaited. Just point your browser at your bookshop front-door file, the one you named back in customize.php--let's say it's red-cats-book-shop.php, so you're looking at http://www.friends-of-red-cats.com/red-cats-book-shop/red-cats-book-shop.php. The page you see should look something like this:
That's all pretty simple and self-evident: the book's title, which is a click-on link; the book's author; the "medium"; the publication date and publisher; the Amazon price to you and best current shipping estimate; and a link to an Abebooks search (of which more in a moment, under Used Books) for used copies of the same title. To see the page you'd get if you clicked on the title, well, click on the title (that sample above works). Before you do, though, let us note that the page you go to will have more or less the same information--only updated the instant you click, so you can be sure the price and availability are exactly up to the minute--plus a really large image of the book's cover (if Amazon has an image, which it usually but not always does), information on whether the book qualifies toward the free-shipping minimum (and a link to more information on Amazon's free-shipping policies), and a one-click button that will put the book in your Amazon "Shopping Cart" (or let you create a Cart if you are one of those ever-fewer folk who haven't bought from Amazon before). Plus: that page will also have all editorial and reader reviews of the book that Amazon has (and the reader reviews are listed in the order that other readers have voted them "useful"). (Those links will bring up new browser windows--just close them when you're through looking and this page will still be here.) A last thought: don't be afraid to add books to your Shopping Cart. You haven't actually bought any books till you go through Amazon's checkout procedure. Till you do, you can add other items to your cart or remove any items already in it (you use Amazon's pages to do those things). New Books on Other SubjectsWe make it easy for you to locate books on Spokane, Washington, but you are not limited to such books. After all, Amazon sells pretty much every single title actually in print! You could, of course, visit Amazon own pages and use their search to locate books. But experienced internet book buyers know that Amazon's searches are imperfect in several ways: they usually don't return all available editions on the first pass, they commonly return all sorts of "non-books" (calendars, post cards, and suchlike junk), and nowadays their "internal search" returns ridiculously long sets of results from which it is hard to find actual books you want. And they clutter up your screen with all sorts of peripheral "information" (read ads) not much related to what you are searching for. This site has a book-search page for Amazon that is similar to but, many feel, much better than Amazon's own. While our page is simple and intuitive to use, it nonetheless has an extensive introduction that points out some Amazon "gotchas" and various ways to improve your search experience. But, even if you read all of that long introduction, you'll only need to go through it once; thereafter, when you visit that search page (we hope you'll bookmark it and use it as your regular new-book shopping tool) you can use the "jump to box" link atop the page to get right to the search box (or you can just bookmark the box once you've jumped to it). If you want, you can visit and test our Amazon book-search page right now--the page will open in a separate browser window, so this page will still be here when you're through looking there. Each result turned up by our searches is roughly similar to the one of the Spokane, Washington-book listings on our alphabetical pages (except that it also shows a small image of the cover, something we don't do on our book-list pages because otherwise they'd take forever to load). When you click on any of the results, you'll be taken to a page exactly like the pages you get to from our lists, which you have probably already seen. They are, like the search-results pages themselves, clean, neat, simple, and easy to look over, unlike the ad-jammed pages Amazon sends you. Our search, like our Spokane, Washington-book lists, defaults to showing you only real books that are really available--but you can very easily change those defaults if you want to see unavailable items (for information purposes) or are interested in related goods (what the trade calls "nonbooks"). Used BooksIf, instead of books available new, you are interested--whether for price or availability reasons--in used books, of any kind (Spokane, Washington or other, that is), we have a nice, simple used-book search page for you; it searches the listings on Abebooks, a listing service with a really huge number of internet used-book-selling members--virtually all internet used-book sellers are Abebooks-listed, from the big guys down to most mom'n'pop operations. If you want, you can visit and test our used-book search page right now--the page will open in a separate browser window, so this page will still be here when you're through looking there. Like the new-book search, this is a very simple, easy-to-use search facility. All The "Spokane, Washington"-Book Pages· "Spokane, Washington" Books Available New Today: By Title:
The "Spokane, Washington"-Books "Master List" (large textfile for special searching) · Search for Any New Book at Any Amazon National Division · Search for Any Used Book at Abebooks This page was designed in accordance with international standards for HTML as set forth by
(That sample page above is functional: once you have executed your trial first run, it will bring up real data; you just can't re-set the division in this docfile sample. Be sure to re-load this docfile after your real run is completed.) What you need to do now is poke around your temporary new bookshop (temporary because we haven't yet customized your search phrase to something relevant to your site.) Look at everything, and make sure it all looks right to you. All links should work, all pages should look correct. (Do remember, of course, that with this low number of titles, many alpha pages will have no listings--that's not a flaw as long as there are some real ones here and there.) Further Checking Your ResultsThere is a handy little tool named status.php included in BookAdder. After poking about, you can also use this to get a clearer status report. Run it (it needs no parameters, just call it by name). The display below is not what you would see after your first trial run (for one thing, that run makes no sitemaps); the sample below is more representative of an actual, operative bookshop--though, in this example, one not SEO-optimized to get at least 4,000 "raw" titles from every division.
Note that even this non-optimized shop is adding about thirty thousand pages (29,932, to be exact) to its associated site. As it says elsewhere, page counts from 45,000 to 50,000 are possible with fully optimized search phrases. If anything--in the Status Report or anywhere--seems wrong at this point, and especially if it seems very wrong, double-check your customizations in customize.php. If you can't find any errors, e-mail me; try to describe the problem in as much detail as you can, and don't forget to give me the URL of your BookAdder directory. If--as will normally be the case--everything looks good, it's time to set you up with a real search phrase and get you going (you are not ready to open up yet). Moving OnBookAdder Documentation Files AvailableThey are:
What to Read NextYou are ready to pick your real search phrase. Click on to proceed to the Tuning Your Search docfile. |