Code Duplication    Length = 11-18 lines in 5 locations

SEOstats/Services/Alexa.php 5 locations

@@ 112-129 (lines=18) @@
109
     * Get the average rank over the last 3 months
110
     * @return int
111
     */
112
    public static function getGlobalRank($url = false)
113
    {
114
        /*
115
        self::setRankingKeys($url);
116
        if (0 == self::$_rankKeys['3m']) {
117
            return parent::noDataDefaultValue();
118
        }
119
        */
120
121
        $xpath = self::_getXPath($url);
122
123
        $xpathQueryList = array(
124
            "//*[@id='traffic-rank-content']/div/span[2]/div[1]/span/span/div/strong",
125
            "//*[@id='traffic-rank-content']/div/span[2]/div[1]/span/span/div/strong/a"
126
        );
127
128
        return static::parseDomByXpathsToIntegerWithoutTags($xpath, $xpathQueryList);
129
    }
130
131
    /**
132
     * Get the average rank over the week
@@ 236-246 (lines=11) @@
233
     * Bounce Rate from alexa
234
     */
235
236
    public static function getBounceRate($url = false)
237
    {
238
        $xpath = self::_getXPath($url);
239
240
        $xpathQueryList = array(
241
            "//*[@id='engagement-content']/span[1]/span/span/div/strong",
242
            "//*[@id='engagement-content']/span[1]/span/span/div/strong/a"
243
        );
244
245
        return static::parseDomByXpathsToIntegerWithoutTags($xpath, $xpathQueryList); 
246
    }
247
    /**
248
     * @author Meraj Ahmad Siddiqui <[email protected]>
249
     * Search Visits  
@@ 251-261 (lines=11) @@
248
     * @author Meraj Ahmad Siddiqui <[email protected]>
249
     * Search Visits  
250
     */
251
    public static function getSearchVisits($url = false)
252
    {
253
        $xpath = self::_getXPath($url);
254
255
        $xpathQueryList = array(
256
            "//*[@id='keyword-content']/span[1]/span/span/div/strong",
257
            "//*[@id='keyword-content']/span[1]/span/span/div/strong/a"
258
        );
259
260
        return static::parseDomByXpathsToIntegerWithoutTags($xpath, $xpathQueryList); 
261
    }
262
263
    /**
264
     * @author Meraj Ahmad Siddiqui <[email protected]>
@@ 267-277 (lines=11) @@
264
     * @author Meraj Ahmad Siddiqui <[email protected]>
265
     * Get daily page views
266
     */
267
    public static function getDailyPageViews($url = false)
268
    {
269
        $xpath = self::_getXPath($url);
270
271
        $xpathQueryList = array(
272
            "//*[@id='engagement-content']/span[2]/span/span/div/strong",
273
            "//*[@id='engagement-content']/span[2]/span/span/div/strong/a"
274
        );
275
276
        return static::parseDomByXpathsToIntegerWithoutTags($xpath, $xpathQueryList); 
277
    }
278
279
    /**
280
     * @author Meraj Ahmad Siddiqui <[email protected]>
@@ 284-294 (lines=11) @@
281
     * Get daily page time on site
282
     */
283
284
    public static function getDailyTimeOnSite($url = false)
285
    {
286
        $xpath = self::_getXPath($url);
287
288
        $xpathQueryList = array(
289
            "//*[@id='engagement-content']/span[3]/span/span/div/strong",
290
            "//*[@id='engagement-content']/span[3]/span/span/div/strong/a"
291
        );
292
293
        return static::parseDomByXpathsToIntegerWithoutTags($xpath, $xpathQueryList); 
294
    }
295
296
    /**
297
     * @author Meraj Ahmad Siddiqui <[email protected]>