Permalink
Browse files

Make backdated entries work properly

If you put a date in your entries, have it mark the entry as backdated
to LiveJournal.
  • Loading branch information...
1 parent 3bed78c commit 566f55663ee8830ce13439a19f3a12df1b217cdd @dagbrown committed with Dave Brown May 27, 2008
Showing with 9 additions and 1 deletion.
  1. +1 −0 bin/ljpost
  2. +8 −1 bin/ljsend
View
@@ -33,6 +33,7 @@ headers["Body"]=bodytext
if headers["Date"] != "" then
headers["Date"]=Time.parse(headers["Date"])
+ headers["Backdate"] = true
else
headers["Date"]=Time.now
end
View
@@ -28,13 +28,20 @@ Dir.open("#{outgoingdir}") do |d|
"Music" => :current_music,
"Userpic" => :picture,
"Security" => :security,
- "Preformatted" => :preformatted,
+ "Preformatted" => :preformatted
}.each do |header, option|
if posting[header] != "" then
opts[option] = posting[header]
end
end
+ if opts.has_key? "Backdate" then
+ if opts["Backdate"] then
+ opts["opt_backdated"] = true
+ end
+ opts.delete "Backdate"
+ end
+
if posting["Date"] != "" then
unless posting["Date"].respond_to? :strftime
posting["Date"] = DateTime.parse(posting["Date"])

0 comments on commit 566f556

Please sign in to comment.