English‎ > ‎Projects‎ > ‎

Blog Replicator

-----------------------------------------------------------------------------+
App.Name         : Blog Replicator
App.Description : Replicates a Blog to a set of Google Site Pages.
Functionality      : Works by reading the Atom Feed for the Blog and using the Google Sites API to create new pages.
-----------------------------------------------------------------------------+

LOCATION: 
  
Process :
  a) Retrieves the ATOM Feed for the Blog defined in Variable [myBlogspot]
           b) Connects to the Google site defined by the variables [domain] and [siteName] 
  c) Navigates to the page defined by varaible [myReplicaPath]
  d) Navigates to (will create, if it doesn't exists) page for this Blog under [myReplicaPath]
  e) For Each Blog entry detected, it will
         e.1) Navigates to (will create, if it doesn't exists) page for this Entry under [myReplicaPath]/BlogName
       e.2) Check Last update time against the Entry's Last Update Time.
                       e.3) If the Blog is newer than the replica, it will update the replica.
  f) If any replica was modified or added, the [myReplicaPath]/BlogName will be updated with a list of all Entries.
  


-----------------------------------------------------------------------------+
 
 NOTES:   
         a) The script is currently customized to replicate entries from Blogger (Blogspot), but it's parametrized so it can be changed to run against other ATOM feeds    
        
         b) The tool is divided on 3 modules: 
             b.1) MAIN this module is the launcher, there is little (but very important) customization to be done in here the CALLReplicateBlog Function must be customized to reflect your needs.
                   You can have multiple copies of the CALLReplicateBlog function one for each Blog to replicate.
          
              b.2) PARAMETERS this modules defines the different ways to show the replicated entries.
                    As of this time, there are only 2 functions on the module:
                       * ReplicateBlog-EN: English texts and times in 12hs. format in US Eastern Standard Time
                       * ReplicateBlog-SP: Spanish texts and times in 24hs. format in Argentinean Unified Time (GMT-3)
                  
                     This modules define the html for the replicas as well as properties like background colors, fonts stiles, etc.
                  
                     You can modify either of those, or make a copy of it, to create your custom version.
           

              b.3) PROGRAM this modules contains all the logic to retrieve the BLOG and it's entries and create the local replicas.
                    There should be no need for changing anything in this module.
                  
                    BUT if you DO change, please share it with me.
                  
                  
                  
        c) You can have multiple copies of the CALLReplicateBlog function calling the same ReplicateBlog, or each calling a different ReplicateBlog function  for each one of them
    
    
 -----------------------------------------------------------------------------+
    
 PROBLEMS / CAVEATS :   
            a) It will NOT replicate the Comments from the Blog entries.
            b) Video, Audio, and other Objects embedded in the Entries might not fully work on the replica.
                This is due to the CAJA framework security settings.
                In THEORY, Video objects from YouTube and similar should work right away, but there is a documented bug in the CAJA wrapper that it's being fixed by Google.
  
-----------------------------------------------------------------------------+



  This is my first attempt at developing an App. Script using the Google Scripting engine, I wanted to reproduce the functionality that I had on my previous site, where an ASPX page replicated my Blogger entries to a cached copy in order to integrate them with my site.

  As described above, this script runs daily and reads the Blog's ATOM feed (Rss) and generates the necessary pages to reproduce the entries.

  The script has a lot of variables that can be customized to adapt the results to the user's needs. including changing the way the entries look (but setting the html accordingly).

  The script has only been tested with Blogger's Blogs, but it should work with any ATOM feed.





Comments