Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > BlueVoda Website Builder Forums > Adding Elements To Your Website

Notices

Adding Elements To Your Website Discussions, help & troubleshooting about adding templates, backgrounds, images, text, iframes, scroll bars, marquees, flash, video, music, HTML Code, shapes, lines, java scripts, and all other elements. Etc… etc…

Reply
 
Thread Tools
  #1  
Old 10-19-2009, 09:25 AM
nzbr's Avatar
Major
 
Join Date: Dec 2006
Posts: 458
Default Keyword tracker. Where to place it?

Hi there,
I've been using 'digital point' site to track my keywords position.
They have changed its system and now they're asking for us to place a code in our site. My question is how do I do that? Here's what they say in their site:

You need to install this script on your web server (that supports PHP 5.2.0 or higher).
In case you are wondering why you have to install a script on your server to enable these functions is because Yahoo and Bing limit the number of API requests made per day on an IP address basis. So this will make the requests from your server IP.
Save this file to your web server that supports PHP (name it whatever you want, but be sure to give it a .php extension), then you can enter the URL in your preferences.

Any ideas of how should I do it?
Thanks a lot!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 10-22-2009, 11:38 AM
nzbr's Avatar
Major
 
Join Date: Dec 2006
Posts: 458
Default Re: Keyword tracker. Where to place it?

No ideas?
thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 10-22-2009, 12:40 PM
Special Status
 
Join Date: Nov 2007
Posts: 435
Arrow Re: Keyword tracker. Where to place it?

Right click a blank spot in your BV page, Page HTML and
drop it at End of Body,

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-9228899-1");
pageTracker._trackPageview();
} catch(err) {}</script>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 10-23-2009, 08:01 AM
nzbr's Avatar
Major
 
Join Date: Dec 2006
Posts: 458
Default Re: Keyword tracker. Where to place it?

Hi there,
They've given me the code. Where do I place it is my question. If i put it at the 'end of body' as you've sugested, it comes up 'behind the page layout. Here is the code:

<?php
error_reporting(E_ALL & ~E_NOTICE);

if ($_REQUEST['v']) {
echo '2';
exit;
}

function get_page($host, $url) {
global $i, $fail_count;
$handle = fsockopen($host, 80, $errno, $errstr, 30);
if (!$handle) {
if ($fail_count < 5) {
$i--;
$fail_count++;
}
} else {
if ($_REQUEST['c']) $cookie = "Cookie: $_REQUEST[c]\r\n";
fwrite ($handle, "GET $url HTTP/1.0\r\nHost: $host\r\nConnection: Close\r\n$cookie\r\n");

while (!feof ($handle)) {
$string = fgetc ($handle);
if ($string == '<' || $string == '{') break;
}
while (!feof($handle)) {
$string .= fread($handle, 40960);
}
fclose($handle);
return $string;
}
}

if ($_REQUEST['t']) {
$query_order = array(1);
} else {
$num = 10;
if ($_REQUEST['se'] == 'y') $num = 50;
if ($_REQUEST['se'] == 'g') $num = 8;

for ($i = 1; $i <= $_REQUEST['d']; $i += $num) {
$query_order[] = $i;
}

if ($_REQUEST['l'] > 0 && $_REQUEST['l'] < 1001) {
$x = $_REQUEST['l'] - 1;
$y = $x - ($x % $num) + 1;
$query_order[$y / $num] = 1;
$query_order[0] = $y;
$slice = array_slice($query_order, 1, max (0, ($y / $num) - 1));
rsort ($slice);
foreach ($slice as $array_key => $value) {
$query_order[$array_key + 1] = $value;
}
}
}

if ($_REQUEST['se'] == 'g') {
$error = '';
$fail_count = 0;
for ($i = 0; $i < count($query_order); $i++) {
@set_time_limit(30);
$start = $query_order[$i];

$data = get_page ('ajax.googleapis.com', '/ajax/services/search/web?v=1.0&rsz=large&start=' . ($start - 1) . '&q=' . urlencode ($_REQUEST['q']));
$parser = json_decode($data, true);

if ($_REQUEST['u']) {
unset ($results_detail);
$position = $start;
foreach ($parser['responseData']['results'] as $result) {
if (substr_count (strtolower ($result['url']), $_REQUEST['u'])) $results[] = $position;

if ($_REQUEST['s']) {
$results_detail[$position]['title'] = $result['title'];
$results_detail[$position]['url'] = $result['unescapedUrl'];
}
$position++;
}
}

$results_total = $parser['responseData']['cursor']['estimatedResultCount'];
if ($error && $fail_count < 5) {
unset ($error);
$i--;
$fail_count++;
}
if ($results) break;
}

} elseif ($_REQUEST['se'] == 'y') {
$error = '';
$fail_count = 0;
for ($i = 0; $i < count($query_order); $i++) {
@set_time_limit(30);
$start = $query_order[$i];

$data = get_page ('api.search.yahoo.com', '/WebSearchService/V1/webSearch?appid=keywordtracker&query=' . urlencode ($_REQUEST['q']) . '&start=' . $start . '&results=50');

$parser = xml_parser_create('UTF-8');
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $data, $vals, $index);
xml_parser_free($parser);

if ($index['ERROR']) {
$error = $vals[$index['MESSAGE'][0]]['value'];
}

if ($_REQUEST['u']) {
unset ($results_detail);
$position = $start;
foreach ($index['URL'] as $url_key) {
if ($vals[$url_key]['level'] == 3) {
if (substr_count (strtolower ($vals[$url_key]['value']), $_REQUEST['u'])) $results[] = $position;

if ($_REQUEST['s']) {
$results_detail[$position]['title'] = $vals[$url_key - 2]['value'];
$results_detail[$position]['summary'] = $vals[$url_key - 1]['value'];
$results_detail[$position]['url'] = $vals[$url_key]['value'];
}
$position++;
}
}
}
$results_total = $vals[$index['RESULTSET'][0]]['attributes']['TOTALRESULTSAVAILABLE'];
if ($error && $fail_count < 5) {
unset ($error);
$i--;
$fail_count++;
}
if ($results_detail) {
if ($_REQUEST['s']) {

$position_key = max(0, min ($results[0] - 4, count ($results_detail) - 10));
$results_detail = array_slice ($results_detail, $position_key, 10);
foreach ($results_detail as $result) {
$position_key++;
$results_new[$position_key] = $result;
}
$results_detail = $results_new;
}
break;
}
}

} elseif ($_REQUEST['se'] == 'b') {
$error = '';
$fail_count = 0;
for ($i = 0; $i < count($query_order); $i++) {
@set_time_limit(30);
$start = $query_order[$i];

$data = get_page ('www.bing.com', '/search?q=' . urlencode ($_REQUEST['q']) . '&first=' . $start . '&count=10&format=rss');

$parser = xml_parser_create('UTF-8');
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $data, $vals, $index);
xml_parser_free($parser);

unset ($results_detail);
$position = $start;
foreach ($index['LINK'] as $url_key) {
if ($vals[$url_key]['level'] == 4 && !strpos($vals[$url_key]['value'], 'www.bing.com:80/search')) {

if (substr_count (strtolower ($vals[$url_key]['value']), $_REQUEST['u'])) $results[] = $position;

if ($_REQUEST['s']) {
$results_detail[$position]['title'] = $vals[$url_key - 1]['value'];
$results_detail[$position]['summary'] = $vals[$url_key + 1]['value'];
$results_detail[$position]['url'] = $vals[$url_key]['value'];
}
$position++;
}
}
if ($results) break;
if ($error && $fail_count < 5) {
unset ($error);
$i--;
$fail_count++;
}
}
}

if (!$results) $results[] = 9999;
$output['results'] = implode ('|', $results);

if ($error) $output['error'] = $error;

if ($_REQUEST['t']) {
$output['total'] = $results_total;
echo serialize($output);
} elseif ($_REQUEST['s']) {
$output['total'] = $results_total;
$output['detail'] = $results_detail;
echo serialize ($output);
} else {
echo serialize ($output);
}

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT +1. The time now is 04:02 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2005-2009 VodaHost Web Hosting Your Perfect Web Host - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203