Class: JustShare::Facebook

Inherits:
SocialLinker show all
Defined in:
lib/just_share/facebook.rb

Instance Attribute Summary

Attributes inherited from SocialLinker

#aux_link, #domain, #hash_tags, #image_url, #message, #params, #path, #title, #via

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SocialLinker

#get_post_link, #initialize, #link

Constructor Details

This class inherits a constructor from JustShare::SocialLinker

Class Method Details

.invite_friends(app_id, msg, redir_url) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/just_share/facebook.rb', line 14

def self.invite_friends app_id, msg, redir_url
  # Base URL
  domain='https://www.facebook.com'
  path='dialog/apprequests'
  params = "app_id=#{app_id}&message=#{msg}&redirect_uri=#{redir_url}"

  "#{domain}/#{path}?#{params}"
end

Instance Method Details

#setup_attrsObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/just_share/facebook.rb', line 2

def setup_attrs
  # Base URL
  self.domain='https://www.facebook.com'
  self.path='sharer/sharer.php'

  # Params (only the link is working, the others are deprecated for the sharer.php & won't work)
  url_param = "u=#{self.link}"

  # build the params
  self.params = "#{url_param}"
end