Module: Twog::Twog
Instance Method Summary
collapse
#ensure_text_is_of_length, #tweet, #update_config_file_with_latest_tweet_date, #use_twitter_oauth
#get_new_blog_posts
#map
Methods included from RssParser
#get_content, #parse_feed
Instance Method Details
#get_bitly_from(conf) ⇒ Object
38
39
40
41
42
43
|
# File 'lib/twog.rb', line 38
def get_bitly_from(conf)
bitly_username = conf['bitly_username']
bitly_api_key = conf['bitly_api_key']
return nil unless (bitly_username && bitly_api_key)
Bitly.new(bitly_username, bitly_api_key)
end
|
32
33
34
35
36
|
# File 'lib/twog.rb', line 32
def (conf)
posts = parse_feed(conf['rss_feed'])
posts = map(posts)
posts = get_new_blog_posts(posts, conf['last_blog_post_tweeted'])
end
|
#run(conf) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/twog.rb', line 25
def run(conf)
posts = (conf)
return unless posts && posts.length > 0
bitly = get_bitly_from(conf)
(posts, conf, bitly)
end
|
#version ⇒ Object
45
46
47
48
|
# File 'lib/twog.rb', line 45
def version
yml = YAML.load(File.read(File.join(File.dirname(__FILE__), *%w[.. VERSION.yml])))
"#{yml[:major]}.#{yml[:minor]}.#{yml[:patch]}"
end
|