Quick update to the Docs to WordPress plugin

We’ve released a quick update to the Docs to WordPress plugin that allows the plugin to integrate with WP Cron rather than requiring you to create your own file to run cron against (though you can still do that, too). To take advantage of it, you’ll have to upgrade to the latest version and edit your wp-config file to define at least three variables:

DOCSTOWP_USER: Your Google Docs username

DOCSTOWP_PASS: Your Google Docs password

DOCSTOWP_ORIGIN: The ID of the origin folder you want to draw the docs from

DOCSTOWP_DESTINATION: This one’s optional, but if defined it will put the docs in this folder when everything is finished processing.

To define a variable:

define( 'DOCSTOWP_USER', 'example@gmail.com' );

To get the ID of the folder, look to the URL. It will look something like this:

https://docs.google.com/#folders/folder.0.!–ID STARTS HERE, AFTER THE 0 and the period –!

A quick note: I decided to hardcode the variables in wp-config instead of using a setting because I’d rather store a plaintext password on the server than in the database. Obviously, neither are ideal, so if anybody has a better solution I’m all ears.

This entry was posted in Plugins. Bookmark the permalink.

25 Responses to Quick update to the Docs to WordPress plugin

  1. I’m still having trouble transfer docs into wordpress. I copy a portion of this docs folder id: folder.0.<–start here 0BwJkzRQCxzFvYTgyNDVlNGQtMzRjMi00ZjRlLWJlMTEtMDFlYWFmY2Q1YTdi

    to define('DOCSTOWP_ORIGIN', 'id_goes_here');

    Still, nothing is transferred.

  2. Alajada says:

    Great plugin made even better with this extension. Took me a few minutes to realise that XAMPP has curl turned off by default, but worked great after fixing this.

    Thanks for sharing.

    • William P. Davis says:

      Yeah, I should use the WordPress HTTP API instead of curl, I just haven’t gotten around to that part yet.

  3. Swapnesh says:

    I activated the plugin(locally) for this page http://localhost/wordpress/?page_id=4, defined the variables as mentioned under wp-config file, kindly elaborate the next steps so that i can have the desired doc content on this particular page..Thx

  4. Nicholas says:

    Very cool plugin! Installed it quickly and painlessly on WP 3.1.3. It is pulling my docs in accurately and the comment/code stripping is working well. The only thing I cannot get to work is using the | character to signify the title. The document title is being used for both the slug and the post title and the title along with with the pipe character is being added into the body copy.

    To confirm, on my UK keyboard, the | character is: Shift + \

    What can I do here?

    Thanks for sharing your plugin. It is really cool! I look forward to seeing how it develops.

  5. Pingback: Новостной сайт на Wordpress и Google Docs

  6. Ben Stern says:

    Hi – I’m also having a little trouble here. If this is the URL for the folder, what is the folder ID exactly?

    https://docs.google.com/a/emeryweiner.org/#folders/folder.0.0B_ebshLIqsz_MzI5MTliZjQtZWMxYS00MDFjLWE5ZWItMTNhOWY3MjJmZjZj

    Thanks!

    • William P. Davis says:

      Ben,
      Sorry for not replying sooner. It seems I shut off my email alerts by accident.

      The ID in this instance is 0B_ebshLIqsz_MzI5MTliZjQtZWMxYS00MDFjLWE5ZWItMTNhOWY3MjJmZjZj.

  7. Philippe says:

    It’s a nice plug-in. Thanks!
    It works well with texte type documents, but I get a “Unauthorized Error 401″ content for spreadsheet type documents.
    Is that normal behaviour or an issue with my parameters?

    Also, I don’t get what is the “DOCSTOWP_DESTINATION”. What is it for?
    Is that a googleDoc collection or a folder on the server? What’s the syntax (trailing /?)

    • William P. Davis says:

      Phillipe,
      Sorry for not replying sooner. It seems I shut off my email alerts by accident.

      Right now we don’t support spreadsheets, just text docs. We recommend embedding spreadsheets, drawings, etc. in a post.

      The DOCSTOWP_DESTINATION is if you want all the docs to go into a different collection after they go through the process. We use this so we can easily tell if a doc has been published, because it will then be in our ‘published’ collection. If you leave that undefined it will just remove the doc from your action folder.

  8. Pingback: Новостной сайт на WordPress и Google Docs | Греху.Нет

  9. Jon Brown says:

    Will – Thank you for creating this, thank you sharing it, and thank you for open sourcing this… really awesome… thank you… and now I have a bunch of questions…

    The plugin in the WP Repo appears newer (0.2-beta) than what is currently on the GitHub repo… Is there a current git repo? different git repo? Are you no longer working/updating the git repo? Not at all complaining, and I’m not ready to fork it yet, but I might and would just as soon start in the right place.

    Is the InDesign plugin going to be open sourced? or has it already been and I just haven’t found it?

    Does the InDesign plugin use xtags or is it completely stand alone?

    • William P. Davis says:

      Jon,
      I need to update the github repo, just haven’t gotten around to it yet. I’ll put that on my to-do list.

      The InDesign plugin isn’t nearly ready for general consumption yet, but we’re hoping to get there soon.

    • William P. Davis says:

      To answer your other question about the InDesign plugin, it converts content from WordPress to InDesign Tagged Text for import onto the page.

      • Jon Brown says:

        Thank you Will for both replies. Might the InDesign plugin be available for private consumption? or collaboration? I may contact you out of comments for more info…

  10. Gary Wilson says:

    I’ve set this up and it works perfectly. The hardest part of the setup was figuring out the right folder ID. While everything from Google Docs transfers easily and quickly, all the formatting is stripped out (bold, italic, etc., that kind of formatting). Is there a setting that needs to be adjusted to keep the formatting during the transfer?

    • William P. Davis says:

      Gary,
      I’m actually working on an update to the plugin right now that will (hopefully) fix that. Currently, though, it’s an all-or-nothing sort of thing — either keep all the formatting or lose all of it.

  11. Seth says:

    I’m seeing a different URL for collections (aka folders): https://docs.google.com/#folders/0BzPwYfQ8qZ-cNDQ4NWMyODctYzA0Zi00ODg4LWJhMjAtMjU4MmY0NmIyMTcy

    Does anyone know if the folder ID in the example above would be 0BzPwYfQ8qZ-cNDQ4NWMyODctYzA0Zi00ODg4LWJhMjAtMjU4MmY0NmIyMTcy

    Thanks!

  12. Cory says:

    Great plugin.

    My understanding of “coding” (for lack of a better term) is rather juvenile, so I’ll do my best to explain my issue.

    With my publication’s WordPress, we use Flutter to create Custom Write Panels so that we can add the writer’s name, photographer, photo caption, etc. When the script pulls the gDoc into WP, these Custom Write Panels are lost in the saved draft.

    Any insight is appreciated.

  13. Ted says:

    A bit late to the party here, but what they hey.
    It seems that folder id formats have evolved, and I’m wondering how to identify the correct id. If my folder URL is this:
    https://drive.google.com/?authuser=0#folders/0BxRl-IYY8DozMjlTMEhDcEtMWUk
    … then what is the id?
    is it this:
    0BxRl-IYY8DozMjlTMEhDcEtMWUk

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>