Class: Booru::Behoimi
Constant Summary
Constants included from Request
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#referer ⇒ Object
Returns the value of attribute referer.
Instance Method Summary collapse
- #hash_password(pass) ⇒ Object
-
#initialize(user = nil, pass = nil) ⇒ Behoimi
constructor
A new instance of Behoimi.
- #url_file_segment(url, md5) ⇒ Object
Methods included from API::Wiki
#create_wiki_page, #destroy_wiki_page, #list_wiki_pages, #lock_wiki_page, #revert_wiki_page, #show_wiki_page, #unlock_wiki_page, #update_wiki_page, #wiki_page_history
Methods included from API::User
Methods included from API::Tag
#list_related_tags, #list_tags, #update_tag
Methods included from API::Post
#create_post, #destroy_post, #list_posts, #post_vote, #revert_post_tags, #update_post
Methods included from API::Pool
#add_pool_post, #create_pool, #destroy_pool, #list_pool_posts, #list_pools, #remove_pool_post, #update_pool
Methods included from API::Note
#list_notes, #note_history, #revert_note, #search_notes, #update_note
Methods included from API::Favorite
Methods included from API::Comment
#create_comment, #destroy_comment, #show_comment
Methods included from API::Artist
#create_artist, #destroy_artist, #list_artists, #update_artist
Methods included from API
#formatted_path, #parse, #query_string
Methods included from Request
Constructor Details
#initialize(user = nil, pass = nil) ⇒ Behoimi
Returns a new instance of Behoimi.
6 7 8 9 10 |
# File 'lib/booru/client/behoimi.rb', line 6 def initialize(user = nil, pass = nil) @host = "http://behoimi.org" @referer = "http://behoimi.org/post/show" super end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/booru/client/behoimi.rb', line 4 def host @host end |
#referer ⇒ Object
Returns the value of attribute referer.
4 5 6 |
# File 'lib/booru/client/behoimi.rb', line 4 def referer @referer end |
Instance Method Details
#hash_password(pass) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/booru/client/behoimi.rb', line 12 def hash_password(pass) salt = 'meganekko-heaven' salted_pass = "#{salt}--#{pass}--" Digest::SHA1.hexdigest(salted_pass) super end |
#url_file_segment(url, md5) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/booru/client/behoimi.rb', line 19 def url_file_segment(url, md5) strings = ["http://behoimi.org/"] strings.each do |str| url = url.gsub(str, "") end url = url.gsub(/data\/.{2}\/.{2}\//,"") super end |