paleo cron

This commit is contained in:
unknown 2015-07-20 15:13:36 +01:00
parent d34714e2e3
commit 5a1cdc5fac
4 changed files with 55 additions and 12 deletions

View File

@ -8,6 +8,11 @@
<set /> <set />
</value> </value>
</entry> </entry>
<entry key="$PROJECT_DIR$/cron.js">
<value>
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/jobs-local.html"> <entry key="$PROJECT_DIR$/jobs-local.html">
<value> <value>
<set /> <set />

View File

@ -54,18 +54,18 @@
<file leaf-file-name="paleo.js" pinned="false" current-in-tab="true"> <file leaf-file-name="paleo.js" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/paleo.js"> <entry file="file://$PROJECT_DIR$/paleo.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.8896552"> <state vertical-scroll-proportion="0.50344825">
<caret line="76" column="25" selection-start-line="76" selection-start-column="25" selection-end-line="76" selection-end-column="25" /> <caret line="98" column="26" selection-start-line="98" selection-start-column="26" selection-end-line="98" selection-end-column="26" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="paleo2.xml" pinned="false" current-in-tab="false"> <file leaf-file-name="cron.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/paleo2.xml"> <entry file="file://$PROJECT_DIR$/cron.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0"> <state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="11" selection-end-column="12" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -146,6 +146,7 @@
<option value="$PROJECT_DIR$/plugins/capitalize_title.js" /> <option value="$PROJECT_DIR$/plugins/capitalize_title.js" />
<option value="$PROJECT_DIR$/plugins/filter_glasgow.js" /> <option value="$PROJECT_DIR$/plugins/filter_glasgow.js" />
<option value="$PROJECT_DIR$/jobs-local.xml" /> <option value="$PROJECT_DIR$/jobs-local.xml" />
<option value="$PROJECT_DIR$/cron.js" />
<option value="$PROJECT_DIR$/paleo.js" /> <option value="$PROJECT_DIR$/paleo.js" />
</list> </list>
</option> </option>
@ -1115,7 +1116,7 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/paleo.xml"> <entry file="file://$PROJECT_DIR$/paleo2.xml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0"> <state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
@ -1123,7 +1124,15 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/paleo2.xml"> <entry file="file://$PROJECT_DIR$/cron.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="11" selection-end-column="12" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/paleo.xml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0"> <state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
@ -1133,8 +1142,8 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/paleo.js"> <entry file="file://$PROJECT_DIR$/paleo.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.8896552"> <state vertical-scroll-proportion="0.50344825">
<caret line="76" column="25" selection-start-line="76" selection-start-column="25" selection-end-line="76" selection-end-column="25" /> <caret line="98" column="26" selection-start-line="98" selection-start-column="26" selection-end-line="98" selection-end-column="26" />
<folding /> <folding />
</state> </state>
</provider> </provider>

12
cron.js Normal file
View File

@ -0,0 +1,12 @@
var CronJob = require('cron').CronJob;
var job = new CronJob({
cronTime: '0 0/60 * 1/1 * ? *',
onTick: function() {
// Runs every weekday (Monday through Friday)
// at 11:30:00 AM. It does not run on Saturday
// or Sunday.
},
start: false,
timeZone: "America/Los_Angeles"
});
job.start();

View File

@ -1,7 +1,7 @@
var RssBraider = require('rss-braider'), fs = require('fs'), var RssBraider = require('rss-braider'), fs = require('fs'), CronJob = require('cron').CronJob,
feeds = {}; feeds = {};
// Pull feeds from config files: // Pull feeds from config files: ,
// feeds.simple_test_feed = require("./config/feed").feed; // feeds.simple_test_feed = require("./config/feed").feed;
// Or define in-line // Or define in-line
feeds.simple_test_feed = { feeds.simple_test_feed = {
@ -81,4 +81,21 @@ rss_braider.processFeed('simple_test_feed', 'rss', function(err, data){
console.log("The file was saved!"); console.log("The file was saved!");
}); });
}); });
var job = new CronJob({
//cronTime: '0 0/60 * 1/1 * ? *',
cronTime: '0 0/5 * 1/1 * ? *',
onTick: function() {
// Runs every hour
console.log('Tick');
},
start: false,
timeZone: "America/Los_Angeles"
});
job.start();