Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Quick web export event sample.

  • Loading branch information...
commit 3a2b7788372bbd94cf3f9607a17741db96f59e23 1 parent 1ebea45
@ccgus authored
View
1  .gitignore
@@ -0,0 +1 @@
+cache-*
View
BIN  templates/RSSWebExportEventSample.vpdoc/pages/5/583ead92-08d5-4f92-b178-51e3f1f1ed05
Binary file not shown
View
46 templates/RSSWebExportEventSample.vpdoc/pages/5/583ead92-08d5-4f92-b178-51e3f1f1ed05.plist
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>aliases</key>
+ <array/>
+ <key>attributes</key>
+ <dict>
+ <key>documentBackgroundColor</key>
+ <data>
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE
+ AWMDhAJmZgEBhg==
+ </data>
+ <key>lastEditingComputerName</key>
+ <string>srv</string>
+ <key>lastEditingUserName</key>
+ <string>August Mueller</string>
+ </dict>
+ <key>categories</key>
+ <array/>
+ <key>createdDate</key>
+ <date>2012-01-22T18:06:16Z</date>
+ <key>dataHash</key>
+ <string>9e0100bfd78723d2aeac17d9b725ad5725df6609</string>
+ <key>displayName</key>
+ <string>Sample Page One</string>
+ <key>encrypted</key>
+ <string>No</string>
+ <key>key</key>
+ <string>sample page one</string>
+ <key>metaValues</key>
+ <dict/>
+ <key>modifiedDate</key>
+ <date>2012-01-22T18:06:27Z</date>
+ <key>shouldHighlightLinks</key>
+ <string>Yes</string>
+ <key>skipOnExport</key>
+ <string>No</string>
+ <key>uti</key>
+ <string>com.apple.rtfd</string>
+ <key>uuid</key>
+ <string>583ead92-08d5-4f92-b178-51e3f1f1ed05</string>
+ <key>version</key>
+ <integer>1</integer>
+</dict>
+</plist>
View
BIN  templates/RSSWebExportEventSample.vpdoc/pages/9/9de9103a-d8ee-454a-a7ee-f66245b2ad0e
Binary file not shown
View
46 templates/RSSWebExportEventSample.vpdoc/pages/9/9de9103a-d8ee-454a-a7ee-f66245b2ad0e.plist
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>aliases</key>
+ <array/>
+ <key>attributes</key>
+ <dict>
+ <key>documentBackgroundColor</key>
+ <data>
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE
+ AWMDhAJmZgEBhg==
+ </data>
+ <key>lastEditingComputerName</key>
+ <string>srv</string>
+ <key>lastEditingUserName</key>
+ <string>August Mueller</string>
+ </dict>
+ <key>categories</key>
+ <array/>
+ <key>createdDate</key>
+ <date>2012-01-22T18:01:16Z</date>
+ <key>dataHash</key>
+ <string>1e3d43e70be888b0552560dbcea7dcbdabbaae6d</string>
+ <key>displayName</key>
+ <string>Index</string>
+ <key>encrypted</key>
+ <string>No</string>
+ <key>key</key>
+ <string>index</string>
+ <key>metaValues</key>
+ <dict/>
+ <key>modifiedDate</key>
+ <date>2012-01-22T18:08:27Z</date>
+ <key>shouldHighlightLinks</key>
+ <string>Yes</string>
+ <key>skipOnExport</key>
+ <string>No</string>
+ <key>uti</key>
+ <string>com.apple.rtfd</string>
+ <key>uuid</key>
+ <string>9de9103a-d8ee-454a-a7ee-f66245b2ad0e</string>
+ <key>version</key>
+ <integer>1</integer>
+</dict>
+</plist>
View
77 templates/RSSWebExportEventSample.vpdoc/pages/9/9e29235c-dae6-42d7-8995-d01f6f0f73df
@@ -0,0 +1,77 @@
+/*
+ This is a sample VPWebExportScript which will spit out an RSS feed for all the pages
+*/
+
+var rss = "";
+var timeFormat = "%Y.%m.%d %I:%m %p"
+
+var baseURL = "http://flyingmeat.com/voodoopad/extras/rsswebexport/";
+
+function webExportWillBegin(contextDictionary) {
+ rss = rss + '<?xml version="1.0" encoding="UTF-8"?>\n'+
+'<rss version="2.0"\n' +
+' xmlns:content="http://purl.org/rss/1.0/modules/content/"\n' +
+' xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"\n' +
+' xmlns:dc="http://purl.org/dc/elements/1.1/"\n' +
+' xmlns:atom="http://www.w3.org/2005/Atom">\n' +
+' <channel>\n' +
+' <title>Sample Title</title>\n' +
+' <link>" + baseURL + "</link>\n' +
+' <atom:link href="' + baseURL + 'rss.xml" rel="self" type="application/rss+xml" />\n' +
+' <pubDate>" + formatDateForRSS(NSDate.date()) + "</pubDate>\n' +
+' <description>Sample Description.</description>\n';
+
+}
+
+function webExportWillMarkupAttributedStringForItem(contextDictionary, item, attributedString) {
+ return attributedString;
+}
+
+function webExportWillWriteHTMLForItem(contextDictionary, item, fileName, mutableHTMLString) {
+
+ rss = rss + " <item>\n" +
+" <title>" + escapeForXML(item.displayName()) + "</title>\n" +
+" <link>" + baseURL + escape(escapeForXML(fileName)) + "</link>\n" +
+" <description>" + escapeForXML(item.stringData()) + "</description>\n" +
+" <guid>" + baseURL + escape(escapeForXML(fileName)) + "</guid>\n" +
+" <pubDate>" + formatDateForRSS(item.createdDate()) + "</pubDate>\n" +
+" </item>\n";
+
+ if (item.key().isEqualToString("index")) {
+
+ // let's add the rss link to our index page.
+ var searchRange = NSMakeRange(0, mutableHTMLString.length());
+ var headAddition = '<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml" />';
+ mutableHTMLString.replaceOccurrencesOfString_withString_options_range_("</head>", headAddition + "\n</head>", 0, searchRange);
+ }
+
+ return mutableHTMLString;
+}
+
+function webExportDidEnd(contextDictionary) {
+
+ rss = rss + " </channel>\n</rss>";
+
+ var s = NSString.stringWithString(rss);
+
+ var outputDirectoryURL = contextDictionary.outputDirectoryURL;
+ var urlToSaveTo = outputDirectoryURL.URLByAppendingPathComponent_("rss.xml");
+ s.writeToURL_atomically_encoding_error_(urlToSaveTo, true, NSUTF8StringEncoding, null);
+
+
+}
+
+function escapeForXML(s) {
+ s = s.stringByReplacingOccurrencesOfString_withString_("&", "&amp;");
+ s = s.stringByReplacingOccurrencesOfString_withString_(">", "&gt;");
+ s = s.stringByReplacingOccurrencesOfString_withString_("<", "&lt;");
+
+ return s;
+}
+
+
+function formatDateForRSS(d) {
+ var df = NSDateFormatter.alloc().init().autorelease();
+ df.setDateFormat("EE, dd MMM yyyy HH:mm:ss Z");
+ return df.stringFromDate(NSDate.date());
+}
View
43 templates/RSSWebExportEventSample.vpdoc/pages/9/9e29235c-dae6-42d7-8995-d01f6f0f73df.plist
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>aliases</key>
+ <array/>
+ <key>attributes</key>
+ <dict>
+ <key>lastEditingComputerName</key>
+ <string>zero</string>
+ <key>lastEditingUserName</key>
+ <string>August Mueller</string>
+ <key>skipOnExport</key>
+ <true/>
+ </dict>
+ <key>categories</key>
+ <array/>
+ <key>createdDate</key>
+ <date>2012-01-22T18:02:18Z</date>
+ <key>dataHash</key>
+ <string>be71274149a60f6782115a60c8a6ca283562d5ec</string>
+ <key>displayName</key>
+ <string>VPWebExportScript</string>
+ <key>encrypted</key>
+ <string>No</string>
+ <key>key</key>
+ <string>vpwebexportscript</string>
+ <key>metaValues</key>
+ <dict/>
+ <key>modifiedDate</key>
+ <date>2012-04-02T19:42:21Z</date>
+ <key>shouldHighlightLinks</key>
+ <string>Yes</string>
+ <key>skipOnExport</key>
+ <string>No</string>
+ <key>uti</key>
+ <string>org.jstalk.jstalk-source</string>
+ <key>uuid</key>
+ <string>9e29235c-dae6-42d7-8995-d01f6f0f73df</string>
+ <key>version</key>
+ <integer>1</integer>
+</dict>
+</plist>
View
BIN  templates/RSSWebExportEventSample.vpdoc/pages/a/a2657b30-7e14-430f-8944-49e293717296
Binary file not shown
View
46 templates/RSSWebExportEventSample.vpdoc/pages/a/a2657b30-7e14-430f-8944-49e293717296.plist
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>aliases</key>
+ <array/>
+ <key>attributes</key>
+ <dict>
+ <key>documentBackgroundColor</key>
+ <data>
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE
+ AWMDhAJmZgEBhg==
+ </data>
+ <key>lastEditingComputerName</key>
+ <string>srv</string>
+ <key>lastEditingUserName</key>
+ <string>August Mueller</string>
+ </dict>
+ <key>categories</key>
+ <array/>
+ <key>createdDate</key>
+ <date>2012-01-22T18:06:31Z</date>
+ <key>dataHash</key>
+ <string>869dcb7e31d7c215bff55f3d67ba0670eb6c5efb</string>
+ <key>displayName</key>
+ <string>Sample Page Two</string>
+ <key>encrypted</key>
+ <string>No</string>
+ <key>key</key>
+ <string>sample page two</string>
+ <key>metaValues</key>
+ <dict/>
+ <key>modifiedDate</key>
+ <date>2012-01-22T18:06:43Z</date>
+ <key>shouldHighlightLinks</key>
+ <string>Yes</string>
+ <key>skipOnExport</key>
+ <string>No</string>
+ <key>uti</key>
+ <string>com.apple.rtfd</string>
+ <key>uuid</key>
+ <string>a2657b30-7e14-430f-8944-49e293717296</string>
+ <key>version</key>
+ <integer>1</integer>
+</dict>
+</plist>
View
50 templates/RSSWebExportEventSample.vpdoc/properties.plist
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>allowPluginLinks</key>
+ <true/>
+ <key>bdToBookmarkAliasUpgrade</key>
+ <true/>
+ <key>createSpotlightIndex</key>
+ <true/>
+ <key>dbVersion</key>
+ <string>7</string>
+ <key>localWebAccess</key>
+ <false/>
+ <key>openWindows</key>
+ <array>
+ <dict>
+ <key>displayUUID</key>
+ <string>9de9103a-d8ee-454a-a7ee-f66245b2ad0e</string>
+ <key>drawerOpen</key>
+ <false/>
+ <key>openUUIDProperties</key>
+ <array>
+ <dict>
+ <key>itemUUID</key>
+ <string>9de9103a-d8ee-454a-a7ee-f66245b2ad0e</string>
+ <key>rulerVisible</key>
+ <false/>
+ <key>selectedRange</key>
+ <string>{0, 0}</string>
+ <key>visibleGlyphs</key>
+ <string>{0, 635}</string>
+ <key>zoomScale</key>
+ <real>1</real>
+ </dict>
+ </array>
+ <key>windowFrame</key>
+ <string>{{910, 343}, {1068, 731}}</string>
+ </dict>
+ </array>
+ <key>skIndexVersion</key>
+ <integer>6</integer>
+ <key>updatedFMPageToRealUTIs</key>
+ <true/>
+ <key>updatedSpecialPages3</key>
+ <true/>
+ <key>uuid</key>
+ <string>94a633ee-3d2b-47ed-b960-99a0e98f82bd</string>
+</dict>
+</plist>
View
12 templates/RSSWebExportEventSample.vpdoc/storeinfo.plist
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>VoodooPadBundleVersion</key>
+ <integer>5</integer>
+ <key>isEncrypted</key>
+ <false/>
+ <key>uuid</key>
+ <string>94a633ee-3d2b-47ed-b960-99a0e98f82bd</string>
+</dict>
+</plist>
View
5 templates/RSSWebExportEventSample.vpdoc/tags.plist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict/>
+</plist>
Please sign in to comment.
Something went wrong with that request. Please try again.