class GrabzIt::HTMLOptions

Represents all of the options available when creating rendered HTML @version 3.0 @author GrabzIt

Public Class Methods

new() click to toggle source
Calls superclass method GrabzIt::BaseOptions::new
# File lib/grabzit/htmloptions.rb, line 8
def initialize()
        super()
        @browserWidth = nil
        @browserHeight = nil
        @waitForElement = nil
        @requestAs = 0
        @noAds = false
        @noCookieNotifications = false
        @address = nil
end

Public Instance Methods

_getParameters(applicationKey, sig, callBackURL, dataName, dataValue) click to toggle source

@!visibility private

# File lib/grabzit/htmloptions.rb, line 146
def _getParameters(applicationKey, sig, callBackURL, dataName, dataValue)
        params = createParameters(applicationKey, sig, callBackURL, dataName, dataValue)             
        params['bwidth'] = GrabzIt::Utility.nil_int_check(@browserWidth)
        params['bheight'] = GrabzIt::Utility.nil_int_check(@browserHeight)
        params['delay'] = GrabzIt::Utility.nil_int_check(@delay)
        params['waitfor'] = GrabzIt::Utility.nil_check(@waitForElement)
        params['requestmobileversion'] = GrabzIt::Utility.nil_int_check(@requestAs)          
        params['noads'] = GrabzIt::Utility.b_to_str(@noAds)
        params['post'] = GrabzIt::Utility.nil_check(@post)
        params['address'] = GrabzIt::Utility.nil_check(@address)
        params['nonotify'] = GrabzIt::Utility.b_to_str(@noCookieNotifications)
        
        return params
end
_getSignatureString(applicationSecret, callBackURL, url = nil) click to toggle source

@!visibility private

# File lib/grabzit/htmloptions.rb, line 133
def _getSignatureString(applicationSecret, callBackURL, url = nil)
        items = [applicationSecret]
        
        if(url != nil)
                items.push(GrabzIt::Utility.nil_check(url))
        end
        
        items.push(GrabzIt::Utility.nil_check(callBackURL),GrabzIt::Utility.nil_int_check(@browserHeight),GrabzIt::Utility.nil_int_check(@browserWidth),GrabzIt::Utility.nil_check(@customId),GrabzIt::Utility.nil_int_check(@delay),GrabzIt::Utility.nil_int_check(@requestAs),GrabzIt::Utility.nil_check(@country),GrabzIt::Utility.nil_check(@exportURL),GrabzIt::Utility.nil_check(@waitForElement),GrabzIt::Utility.nil_check(@encryptionKey),GrabzIt::Utility.b_to_str(@noAds),GrabzIt::Utility.nil_check(@post),GrabzIt::Utility.nil_check(@proxy),GrabzIt::Utility.nil_check(@address),GrabzIt::Utility.b_to_str(@noCookieNotifications))
        
        return items.join("|")
end
add_post_parameter(name, value) click to toggle source

Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force GrabzIt to perform a HTTP post.

@param name [String] the name of the HTTP Post parameter @param value [String] the value of the HTTP Post parameter

# File lib/grabzit/htmloptions.rb, line 128
def add_post_parameter(name, value)
        @post = appendParameter(@post, name, value)
end
address() click to toggle source

@return [String] get the URL to execute the HTML code in

# File lib/grabzit/htmloptions.rb, line 111
def address
        @address
end
address=(value) click to toggle source

Set the URL to execute the HTML code in

@param value [String] the address @return [void]

# File lib/grabzit/htmloptions.rb, line 119
def address=(value)
        @address = value
end
browserHeight() click to toggle source

@return [Integer] the height of the browser in pixels

# File lib/grabzit/htmloptions.rb, line 33
def browserHeight
        @browserHeight
end
browserHeight=(value) click to toggle source

Set the height of the browser in pixels. Use -1 to screenshot the whole web page

@param value [Integer] the browser height @return [void]

# File lib/grabzit/htmloptions.rb, line 41
def browserHeight=(value)
        @browserHeight = value
end
browserWidth() click to toggle source

@return [Integer] the width of the browser in pixels

# File lib/grabzit/htmloptions.rb, line 20
def browserWidth
        @browserWidth
end
browserWidth=(value) click to toggle source

Set the width of the browser in pixels

@param value [Integer] the browser width @return [void]

# File lib/grabzit/htmloptions.rb, line 28
def browserWidth=(value)
        @browserWidth = value
end
delay() click to toggle source

@return [Integer] get the number of milliseconds to wait before creating the capture

# File lib/grabzit/htmloptions.rb, line 46
def delay
        @delay
end
delay=(value) click to toggle source

Set the number of milliseconds to wait before creating the capture

@param value [Integer] the delay @return [void]

# File lib/grabzit/htmloptions.rb, line 54
def delay=(value)
        @delay = value
end
noAds() click to toggle source

@return [Boolean] get if adverts should be automatically hidden

# File lib/grabzit/htmloptions.rb, line 85
def noAds
        @noAds
end
noAds=(value) click to toggle source

Set to true if adverts should be automatically hidden

@param value [Boolean] hide adverts @return [void]

# File lib/grabzit/htmloptions.rb, line 93
def noAds=(value)
        @noAds = value
end
noCookieNotifications() click to toggle source

@return [Boolean] get if cookie notifications should be automatically hidden

# File lib/grabzit/htmloptions.rb, line 98
def noCookieNotifications
        @noCookieNotifications
end
noCookieNotifications=(value) click to toggle source

Set to true if cookie notifications should be automatically hidden

@param value [Boolean] hide cookie notifications @return [void]

# File lib/grabzit/htmloptions.rb, line 106
def noCookieNotifications=(value)
        @noCookieNotifications = value
end
requestAs() click to toggle source

@return [Integer] get which user agent type should be used

# File lib/grabzit/htmloptions.rb, line 72
def requestAs
        @requestAs
end
requestAs=(value) click to toggle source

Set which user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3

@param value [Integer] the browser type @return [void]

# File lib/grabzit/htmloptions.rb, line 80
def requestAs=(value)
        @requestAs = value
end
waitForElement() click to toggle source

@return [String] get the CSS selector of the HTML element in the web page that must be visible before the capture is performed

# File lib/grabzit/htmloptions.rb, line 59
def waitForElement
        @waitForElement
end
waitForElement=(value) click to toggle source

Set the CSS selector of the HTML element in the web page that must be visible before the capture is performed

@param value [String] the element to wait for @return [void]

# File lib/grabzit/htmloptions.rb, line 67
def waitForElement=(value)
        @waitForElement = value
end