hypertagger
An alternative to bookmarks
share websites with one right click
For this extension to work you need 3 things
- this extension
- ajax endpoint to store information on server
- web site to read the information and present as links
The endpoint should return json with
'status' key and info on successful recording of data
or
'error' key and info on reason of failure
Here is a simple example of ajax endpoint code that will append bookmarks and titles (prompts) to the file hypertagger.html
<?php
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
function append($sz="", $name='sharedLinks.html',$mode='a') {
$fp=fopen($name,$mode);
$fret = fwrite($fp,$sz."\r\n");
fclose($fp);
return $fret;
}
$pageUrl = @$_REQUEST['pageUrl'];
$prompt = @$_REQUEST['prompt'];
if(!$prompt) {
$prompt = "no title";
}
$bytesWritten = 0;
if($pageUrl) {
$bytesWritten = append("<a href='$pageUrl' >$prompt</a><br>");
} else {
}
$success = "OK: bytes written $bytesWritten";
$error = NULL;
$result = array(
'status' => $success,
'error' => $error,
'request' => @$_REQUEST
);
echo json_encode($result);
You can test the extension with the following:
| https://hypertagger.com/ajaxHyperTagger.php | the code above |
| https://hypertagger.com/fakeSuccessServer.php | returns success |
| https://hypertagger.com/fakeErrorServer.php | returns error |
download hypertagger extension
see sharedLinks.html
clear sharedLinks.html