Add this toolbar, and nccu calendar fix
This commit is contained in:
1 parent
2f500ff460
commit
8dd1ab32c1
13 files changed
+47
-10
No files matched your search
@@ -3,6 +3,10 @@ class BackupServer
|
||||
|
||||
def self.perform()
|
||||
CronMail.time_check("Going to backup Orbit").deliver
|
||||
dbhost = Mongoid.config.database.connection.primary.join ':'
|
||||
dbname = Mongoid.config.database.name
|
||||
dbdirectory = "#{Rails.root}/tmp/#{dbname}-"+Time.now.strftime("%Y-%m-%d-%H-%M")
|
||||
%x[mongodump -h dbhost -d dbname -o dbdirectory ]
|
||||
# %x[touch #{Rails.root}/tmp/restart]
|
||||
end
|
||||
end
|
||||
@@ -5,11 +5,17 @@ class NccuCalendar
|
||||
@queue = :high
|
||||
|
||||
def self.perform()
|
||||
temp_file = Tempfile.new('new_cal')
|
||||
temp_file << open('http://events.nccu.edu.tw/Month').read
|
||||
# temp_file = Tempfile.new('new_cal')
|
||||
# open('http://events.nccu.edu.tw/Month').read{|data|
|
||||
# temp_file << data
|
||||
# }
|
||||
|
||||
FileUtils.mv(temp_file, File.join(Rails.root, 'public/static', 'nccu_calendar.xml'))
|
||||
open(File.join(Rails.root, 'public/static', 'nccu_calendar.xml'), 'wb') do |fo|
|
||||
fo.print open('http://events.nccu.edu.tw/Month').read
|
||||
end
|
||||
|
||||
puts "NccuCalendar Synced"
|
||||
# FileUtils.mv(temp_file, File.join(Rails.root, 'public/static', 'nccu_calendar.xml'))
|
||||
|
||||
puts "NccuCalendar Synced4"
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
<!-- AddThis Button BEGIN -->
|
||||
<div class="addthis_toolbox addthis_default_style ">
|
||||
<a href="http://www.addthis.com/bookmark.php?v=250&username=ra-4fc5b9b95a5e9034" class="addthis_button_compact"><%= t("addthis_tools.add_to_bookmark")%></a>
|
||||
<span class="addthis_separator">|</span>
|
||||
<a class="addthis_button_facebook" style="cursor:Pointer"></a>
|
||||
<a class="addthis_button_twitter" style="cursor:Pointer"></a>
|
||||
<a class="addthis_button_plurk" style="cursor:Pointer"></a>
|
||||
<a class="addthis_button_email" style="cursor:Pointer"></a>
|
||||
<!--<a href="<?php echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] ?>&print=friendly"><img src="../images/print.jpg" alt="友善列印"
|
||||
></a>-->
|
||||
</div>
|
||||
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
|
||||
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4fc5b9b95a5e9034"></script>
|
||||
<!-- AddThis Button END -->
|
||||
Reference in new issue
Block a user