module Reflection

Adds capability to examine for posts, articles, and links.

Public Instance Methods

possible_success?() click to toggle source

Determines if bot can crawl a Popular section. If it doesn’t see popular at first glance, it searches and navigates to Posts page (Articles or Blog).

If Popular section still doesn’t exist, it’s a no-go.

# File lib/blogbot/reflection.rb, line 35
def possible_success?
  if see_popular? == true
    true
  elsif see_posts? == true
    go_to_posts_page # Changes page to look for popular.
    answer =  see_popular? == true ? true : false # true if popular is present
    previous_page # Check is complete. Return to original page.
    answer
  else
    false
  end
end
see_posts?() click to toggle source

Searches for link that says articles or blog.

# File lib/blogbot/reflection.rb, line 4
def see_posts?
  find_posts_url
  if @article_link.nil? == true && @blog_link.nil? == true
    false # => no article links found
  else
    true
  end
end