What is this?
BabelFox is a small web application that takes a Google spreadsheet and converts it into a fancy
FoxReplace file, complete with custom regular expressions and other bells and whistles. All of the magic happens
here.
For example, observe what happens to a page at the Economist:
While the point is to help you to practice language learning while you surf the web, it can be used to convert any type of FoxReplace list. Lists are given a permalink that can be shared with others (either through email or through the Shared Library on this site), all without exposing your Google account name or the original document's URL.
For more information, read this blog post.
Step 1: Install FoxReplace
You need to be using the FireFox browser, and you need to install the FoxReplace add-on.
You can get Firefox here: www.mozilla.com/firefox
You can get FoxReplace here: https://addons.mozilla.org/firefox/addon/6510
If you just want to see BabelFox in action without creating your own spreadsheet, you can skip to Step 4.
Creating a spreadsheet
The Share button
The spreadsheet's published URL
Step 2: Create an online spreadsheet using Google Docs
If you don't have a Google account, get one
here.
Create a new spreadsheet in Google Docs (
http://docs.google.com) by selecting "Spreadsheet" from the "New" dropdown.
Set up your spreadsheet like this:
- The title of the document becomes the title of the BabelFox output.
- You need a header row, but it is ultimately ignored. Use it to label your entries.
- The third and fourth columns are optional.
Now just fill your spreadsheet! There is no size limit, although extremely large sets may slow down Firefox.
Step 3: Publish your spreadsheet and copy the published URL
Click on the "Share" dropdown on the upper right side of your Google spreadsheet and select "Publish as web page."
Copy the entire link that appears, which should look something like this...
http://spreadsheets.google.com/pub?key=xxXXxXxxxXxXxxXxXXXXXxXx
...and then click "Publish now." Select the "Automatically re-publish when changes are made" option. Note: If you ever change the status to "Stop publishing," then the spreadsheet will no longer be available to BabelFox.
Opening the FoxReplace options
The Import button
Step 5: Import into FoxReplace
If everything went smoothly with loading and processing the spreadsheet, you should have already saved your custom output file to your hard drive. Now all that is left is to
put that XML file into FoxReplace.
(With luck, I might be able to convince the author of FoxReplace to create a "subscriptions" feature to automatically sync one's FoxReplace list to an online XML file--which would mean that changes to your Google spreadsheet would immediately be updated into your replacement list via BabelFox like magic. Until then, however, this is what you need to do....)
Go to Firefox's "Tools" menu, find the "FoxReplace" item, and click the "FoxReplace options..." link. (Also, I recommend turning "Auto-replace with page load" on.)
From the options menu, click on the "Import" button in the lower right hand corner. Then select your saved BabelFox XML file, press "Open," and you're good to go!
Troubleshooting
- Make sure that your FoxReplace add-on is installed (you need to restart Firefox if you haven't already).
- Make sure your spreadsheet is still "publishing" and that it is set to auto-refresh.
- If you are using a set from the Shared Library that isn't working, its likely because the author has stop publishing it. Nothing can be done about that, I'm afraid. I'll try to clean out dead spreadsheets.
- Keep in mind that some regular expressions may bog down Firefox. If the script consistently takes a lnog time to process on your computer, considering changing the regular expression search input.
Source Code
I'd be happy to share any of the code used to grab the spreadsheet data, generate the XML, or display this page. Just post a comment below.
BabelFox was built with ColdFusion, Scriptaculous, and SACK. The Comments section is a modded template from BlogCFC.
Feedback
Comments
Comment Moderation is enabled. Your comment will not appear until approved.I use foxreplace too. Currently, i create the xml by hand and would be interested in how you created the xml file automatically. Thanks.. Gail
The XML is generated using a ColdFusion server-side script. I put the data from Google Spreadsheets into a 2-D array, then its just a simple output loop into an cfm file with an XML cfheader.
You are free to use BabelFox to automate the process, and you can keep your XML output private; just follow the steps on http://elliottandlara.com/babelfox (first create a Google Spreadsheet, provide its published URL in the box at Step 4, and then download the XML file). Please try it out, and let me know what you think!
I just got word from FoxReplace's author that he can add an "import online XML" feature in the next release, and maybe a syncing feature down the road. So it will be even easier...you'll just need to update a Google spreadsheet to manage your FoxReplace set.
Thanks! Just be careful if you do it on a shared computer; its easy to forget about the prank and get confused yourself. ;-)
TIA
I've been trying to edit an existing FoxReplace.xml file by hand, adding just the <substitution><substitution> tags ans everything in between, but I can't get FoxReplace to import it.
Any help would be appreciated. Congratulations on your work.
I don't have a ton of time, but i could give it a quick look. You could email me (elliottandlara@gmail.com) your by-hand XML file and the URL to your published Google Doc, and I'll take a look at them both and see if I have any suggestions.