This repository has been archived by the owner on Jun 24, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: svn+ssh://svn.osteele.com/home/osteele/svn/projects/cloud@24 e7b8d44c-8308-0410-acfb-b763ae30a170
- Loading branch information
Showing
4 changed files
with
101 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
require 'rake/clean' | ||
require 'ows_tasks' | ||
require 'laszlo' | ||
#require 'laszlo_tasks' | ||
|
||
file 'cloud.lzx.swf' => ['cloud.lzx', 'analyzer.js'] do |t| | ||
task :default => :upload | ||
CLEAN.include '*.lzx.swf' | ||
CLEAN.include 'index.html' | ||
UPLOADS = %w{cloud.swf index.html proxy.php} | ||
|
||
file 'cloud.swf' => ['cloud.lzx', 'analyzer.js'] do |t| | ||
puts "Compiling #{t.prerequisites.first} => #{t.name}" | ||
Laszlo::compile t.prerequisites.first, :output => t.name | ||
end | ||
|
||
file 'index.html' => 'cloud.lzx' do |t| | ||
Laszlo::make_html t.prerequisites.first, :output => t.name | ||
task :proxy do | ||
sync 'proxy.php', File.expand_path('~/Sites/proxy.php') | ||
end | ||
|
||
task :upload => ['cloud.lzx.swf', 'index.html'] do | ||
`scp cloud.lzx.swf index.html osteele@osteele.com:osteele.com/projects/cloud-visualizer` | ||
task :deploy do | ||
onserver = "osteele@osteele.com:expialidocio.us" | ||
UPLOADS.each do |f| | ||
puts "Uploading #{f}" | ||
`rsync -avz -e ssh "#{f}" "#{onserver}"` | ||
end | ||
end | ||
|
||
task :default => :upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
<!DOCTYPE html | ||
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||
"http://www.w3.org/TR/html4/loose.dtd"> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
|
||
<link rel="SHORTCUT ICON" href="http://www.laszlosystems.com/favicon.ico"> | ||
<title>expialidocio.us</title><style type="text/css"> | ||
html, body { margin: 0; padding: 0; height: 100%; } | ||
body { background-color: #ffffff; } | ||
</style></head> | ||
<body><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" | ||
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" | ||
data="cloud.swf?source=proxy&lzproxied=false" width="100%" height="100%"> | ||
<param name="movie" value="cloud.swf?source=proxy&lzproxied=false"> | ||
<param name="quality" value="high"> | ||
<param name="scale" value="noscale"> | ||
<param name="salign" value="LT"> | ||
<param name="menu" value="false"> | ||
<param name="bgcolor" value="#ffffff"> | ||
<embed src="cloud.swf?source=proxy&lzproxied=false" quality="high" | ||
scale="noscale" salign="lt" width="100%" height="100%" bgcolor="#ffffff" | ||
type="application/x-shockwave-flash" | ||
pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,52 @@ | ||
<?php | ||
//die('user='.$_SERVER['PHP_AUTH_USER']); | ||
if (!isset($_SERVER['PHP_AUTH_USER'])) { | ||
header('WWW-Authenticate: Basic realm="My Realm"'); | ||
header('HTTP/1.0 401 Unauthorized'); | ||
echo 'Text to send if user hits Cancel button'; | ||
exit; | ||
header('WWW-Authenticate: Basic realm="del.iciou.us account info"'); | ||
header('HTTP/1.0 401 Unauthorized'); | ||
echo '<cancel/>'; | ||
exit; | ||
} else { | ||
$timefile='time.txt'; | ||
$lockfile='lock.txt'; | ||
clearstatcache(); | ||
|
||
$fp=fopen($lockfile,'w'); | ||
flock($fp, LOCK_EX); | ||
$fm = filemtime($timefile); | ||
$next_access_time = $fm + 1; | ||
$delay = $next_access_time - time(); | ||
//if ($delay > 0) sleep($delay); | ||
|
||
$fp2 = fopen($timefile, 'w'); | ||
fwrite($fp2, "$next_access_time\n"); | ||
fclose($fp2); | ||
|
||
flock($fp, LOCK_UN); | ||
fclose($fp); | ||
|
||
$user = $_SERVER['PHP_AUTH_USER']; | ||
$passwd = $_SERVER['PHP_AUTH_PW']; | ||
if ($user == 'ows') $user = 'osteele'; | ||
$user = 'osteele'; | ||
$passwd = 'pa55wdde'; | ||
//if ($passwd == 'passwd') $passwd = 'pa55wdde'; | ||
$url = "http://".$user.":".$passwd."@del.icio.us/api/posts/all"; | ||
$file = @fopen($url, "r"); | ||
//$file = fsockopen("www.example.com", 80, $errno, $errstr, 30); | ||
//die('err '.$errno.', '.$errstr); | ||
//$url = "http://".$user.":".$passwd."@del.icio.us/api/posts/all"; | ||
$url = "http://del.icio.us/api/posts/all"; | ||
|
||
$ch = curl_init($url); | ||
curl_setopt($ch, CURLOPT_USERAGENT, 'expialidocio.us'); | ||
curl_setopt($ch, CURLOPT_USERPWD, $user.':'.$passwd); | ||
curl_exec($ch); | ||
curl_close($ch); | ||
exit; | ||
//curl_errno and curl_error | ||
// int: CURLOPT_CONNECTTIMEOUT CURLOPT_HTTPAUTH=CURLAUTH_BASIC CURLOPT_MAXREDIRS | ||
// bool: CURLOPT_FAILONERROR CURLOPT_FOLLOWLOCATION CURLOPT_HEADER CURLOPT_RETURNTRANSFER | ||
// string: CURLOPT_REFERER | ||
// array: CURLOPT_HTTPHEADER | ||
//_error | ||
//_setopt | ||
|
||
if (!$file) { | ||
die('no file'); | ||
header('WWW-Authenticate: Basic realm="My Realm"'); | ||
header('HTTP/1.0 401 Unauthorized'); | ||
echo "del.icio.us didn't like that username and password."; | ||
} | ||
//die($http_response_header); | ||
header("Content-type: application/xml"); | ||
while (!feof($file)) { | ||
$line = fgets($file, 1024); | ||
echo $line; | ||
} | ||
fclose($file); | ||
} | ||
// $http_response_header or stream_get_meta_data() | ||
?> | ||
?> |