forked from huacnlee/personlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
38 lines (33 loc) · 1.04 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
Personlab::Application.load_tasks
# Twitter
namespace :tweet do
desc "Twitter reload."
task :update => :environment do
setting = Setting.find_create
if !setting.fanfou_id.blank?
puts "#{Time.now}"
puts 'Load tweets from twitter.com...'
items = Tweet.get_home_messages(setting.fanfou_id,5,true)
if items.blank?
puts "Not found or get error."
else
puts "Done. there have #{items.count} tweet."
end
end
end
end
# Google Reader
namespace :reader_share do
desc "Google Reader reload shere items."
task :update => :environment do
setting = Setting.find_create
puts "#{Time.now}"
puts 'Load Google Reader share articles...'
items = Share.find_all(setting,true)
puts "Done. there got #{items.count} articles from Google Reader."
end
end