Permalink
Browse files

changed item guids

  • Loading branch information...
1 parent 225a0e1 commit 63571c8a1761f82a373f993a2f3b4182affa794d @anatolyg committed Apr 2, 2013
Showing with 13 additions and 4 deletions.
  1. +3 −3 .idea/workspace.xml
  2. +10 −1 web.js
View
@@ -8,7 +8,7 @@
<ignored path=".idea/workspace.xml" />
<file path="/Dummy.txt" changelist="1c334c57-5d1a-4fb5-ba49-2cbf3f060481" time="1364889002439" ignored="false" />
<file path="/rss.js" changelist="1c334c57-5d1a-4fb5-ba49-2cbf3f060481" time="1364889040497" ignored="false" />
- <file path="/web.js" changelist="1c334c57-5d1a-4fb5-ba49-2cbf3f060481" time="1364889463144" ignored="false" />
+ <file path="/web.js" changelist="1c334c57-5d1a-4fb5-ba49-2cbf3f060481" time="1364911841630" ignored="false" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -42,7 +42,7 @@
<file leaf-file-name="web.js" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/web.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="51" column="29" selection-start="1898" selection-end="1898" vertical-scroll-proportion="0.6435331">
+ <state line="60" column="29" selection-start="2113" selection-end="2113" vertical-scroll-proportion="0.7570978">
<folding />
</state>
</provider>
@@ -344,7 +344,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/web.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="51" column="29" selection-start="1898" selection-end="1898" vertical-scroll-proportion="0.6435331">
+ <state line="60" column="29" selection-start="2113" selection-end="2113" vertical-scroll-proportion="0.7570978">
<folding />
</state>
</provider>
View
11 web.js
@@ -11,6 +11,15 @@ app.listen(port, function() {
console.log("Listening on " + port);
});
+function genGUID () {
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+ var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
+ return v.toString(16);
+ });
+}
+
+
+
app.get('/', function(req, res) {
var feed = new rss({
title: 'Anatoly\'s Activities',
@@ -49,7 +58,7 @@ app.get('/', function(req, res) {
date: article.date || (new Date()),
pubDate: article.pubDate || (new Date()),
url: article.link || '',
- guid: linkUrl,
+ guid: genGUID(),
categories: article.categories ? _.uniq(article.categories) : '',
'georss:point': article['georss:point'] || ''
});

0 comments on commit 63571c8

Please sign in to comment.