Add unobfuscated code from @SirWumpus
The entries 2004/hibachi and 2005/mynx have unobfuscated code now. 2004/hibachi has a configure script that is used along the lines of the original entry (with some adjustments and fixes) and the hibachi.alt.c had to have ctype.h included too. The directory src/localhost was copied to src-alt/localhost but the rest of src/ was from Anthony. The Makefile had to be updated to build this version. 2005/mynx does have a configure script but it is, just like the original entry, unused and so the unobfuscated (in source-alt/) is also unused. The mynx.alt.c was changed to mynx.alt2.c and the unobfuscated code was made mynx.alt.c. Updated manifest, rebuilt .entry.json and index.html files. After a question is answered and taken care of (in one of 199[1-3]/ant - not sure which one) issue #2513 can possibly be closed as complete (though the manifest updates will have to be looked at more when 2004 and 2005 are reviewed).
This commit is contained in:
1 parent
60ce3d9155
commit
0d65af1b2b
65 files changed
+15579
-218
No files matched your search
@@ -0,0 +1,66 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>
|
||||
Hibachi - Stock Price Example in Perl
|
||||
</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css">
|
||||
<script language="JavaScript" type="text/javascript" src="yahoo-ticker.pl?DIR.V"></script>
|
||||
</head>
|
||||
<body background="../../Img/hot-coal-edge-110-indent.png" style="margins: 0 0 0 0; padding: 0 0 0 0;">
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td width="130">
|
||||
<img alt="" src="../../Img/mrpixel.gif" width="130" height="1">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<h2>Stock Price Fetch Example in Perl</h2>
|
||||
<p>
|
||||
(This example requires JavaScript.)
|
||||
</p>
|
||||
|
||||
<table border="0" style="margin: 30 20 30 0;">
|
||||
<tr>
|
||||
<td rowspan="7">
|
||||
|
||||
</td>
|
||||
<th style="text-align: right;">Exchange : </th><td>CDNX</td>
|
||||
</tr><tr>
|
||||
<th style="text-align: right;">Symbol : </th><td>DIR</td>
|
||||
</tr><tr>
|
||||
<th style="text-align: right;">Share Price : </th>
|
||||
<td>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
document.write(ticker['price']);
|
||||
</script>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: right;">Volume : </th>
|
||||
<td>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
document.write(ticker['volume']);
|
||||
</script>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th style="text-align: right;">Last Trade : </th>
|
||||
<td>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
document.write(ticker['last']);
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr/>
|
||||
<a href="../../#Test">Return to HIBACHI</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# yahoo-ticker.pl
|
||||
#
|
||||
# Copyright 1998 by Anthony Howe. All rights reserved.
|
||||
#
|
||||
# Usage: yahoo-ticker.pl?<symbol>
|
||||
#
|
||||
|
||||
##########################################################################
|
||||
# Nothing to be configured below this point.
|
||||
##########################################################################
|
||||
|
||||
use Socket;
|
||||
|
||||
# WORK-AROUND 1.
|
||||
# BAH! Some Perl implementations (for Windows) are not created equal.
|
||||
# Force I/O flushes after each read/write operation.
|
||||
|
||||
$| = 1;
|
||||
|
||||
#########################################################################
|
||||
# Open connection to URL.
|
||||
#########################################################################
|
||||
|
||||
my ($symbol) = $ENV{'QUERY_STRING'} =~ /\??(.*)/;
|
||||
|
||||
# Figure out who we have to call.
|
||||
#($host, $port, $path) = ($url =~ m!http://([^:/]+)(?:\:(\d*))?(/.*)!);
|
||||
|
||||
$host = "finance.yahoo.com";
|
||||
$port = 80 unless defined $port;
|
||||
$path = "/q?s=$symbol";
|
||||
|
||||
# Get a socket...
|
||||
unless (socket(HTTP, PF_INET, SOCK_STREAM, getprotobyname('tcp'))) {
|
||||
print("[CGI failed ($!)]\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
# ...set socket to be line buffered...
|
||||
select( (select(HTTP), $| = 1)[0] );
|
||||
|
||||
# .. make the connection.
|
||||
unless (connect(HTTP, sockaddr_in($port, inet_aton("$host")))) {
|
||||
print("[CGI failed ($!)]\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
print HTTP "GET $path HTTP/1.0\nHost: $host\n\n";
|
||||
|
||||
while (<HTTP>) {
|
||||
# Last trade price line.
|
||||
if (m!>Last Trade:<!) {
|
||||
($price) = (m!Last Trade:</td><td class="yfnc_tabledata1"><big><b>(\d+\.\d+)</b></big></td>!);
|
||||
}
|
||||
|
||||
if (m!>Trade Time:<!) {
|
||||
($last) = (m!Trade Time:</td><td class="yfnc_tabledata1">([^<]+)</td>!);
|
||||
}
|
||||
|
||||
if (m!>Volume:<!) {
|
||||
($volume) = (m!Volume:</td><td class="yfnc_tabledata1">([^<]+)</td>!);
|
||||
}
|
||||
}
|
||||
|
||||
close(HTTP);
|
||||
|
||||
print "HTTP/1.0 200 OK\n";
|
||||
print "Content-Type: text/javascript\n\n";
|
||||
|
||||
print "var ticker = new Array();\n";
|
||||
print "ticker['price'] = $price;\n";
|
||||
print "ticker['volume'] = \"$volume\";\n";
|
||||
print "ticker['last'] = \"$last\";\n";
|
||||
|
||||
exit 0;
|
||||
@@ -0,0 +1,77 @@
|
||||
#!@perl_exe@
|
||||
#
|
||||
# yahoo-ticker.pl
|
||||
#
|
||||
# Copyright 1998 by Anthony Howe. All rights reserved.
|
||||
#
|
||||
# Usage: yahoo-ticker.pl?<symbol>
|
||||
#
|
||||
|
||||
##########################################################################
|
||||
# Nothing to be configured below this point.
|
||||
##########################################################################
|
||||
|
||||
use Socket;
|
||||
|
||||
# WORK-AROUND 1.
|
||||
# BAH! Some Perl implementations (for Windows) are not created equal.
|
||||
# Force I/O flushes after each read/write operation.
|
||||
|
||||
$| = 1;
|
||||
|
||||
#########################################################################
|
||||
# Open connection to URL.
|
||||
#########################################################################
|
||||
|
||||
my ($symbol) = $ENV{'QUERY_STRING'} =~ /\??(.*)/;
|
||||
|
||||
# Figure out who we have to call.
|
||||
#($host, $port, $path) = ($url =~ m!http://([^:/]+)(?:\:(\d*))?(/.*)!);
|
||||
|
||||
$host = "finance.yahoo.com";
|
||||
$port = 80 unless defined $port;
|
||||
$path = "/q?s=$symbol";
|
||||
|
||||
# Get a socket...
|
||||
unless (socket(HTTP, PF_INET, SOCK_STREAM, getprotobyname('tcp'))) {
|
||||
print("[CGI failed ($!)]\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
# ...set socket to be line buffered...
|
||||
select( (select(HTTP), $| = 1)[0] );
|
||||
|
||||
# .. make the connection.
|
||||
unless (connect(HTTP, sockaddr_in($port, inet_aton("$host")))) {
|
||||
print("[CGI failed ($!)]\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
print HTTP "GET $path HTTP/1.0\nHost: $host\n\n";
|
||||
|
||||
while (<HTTP>) {
|
||||
# Last trade price line.
|
||||
if (m!>Last Trade:<!) {
|
||||
($price) = (m!Last Trade:</td><td class="yfnc_tabledata1"><big><b>(\d+\.\d+)</b></big></td>!);
|
||||
}
|
||||
|
||||
if (m!>Trade Time:<!) {
|
||||
($last) = (m!Trade Time:</td><td class="yfnc_tabledata1">([^<]+)</td>!);
|
||||
}
|
||||
|
||||
if (m!>Volume:<!) {
|
||||
($volume) = (m!Volume:</td><td class="yfnc_tabledata1">([^<]+)</td>!);
|
||||
}
|
||||
}
|
||||
|
||||
close(HTTP);
|
||||
|
||||
print "HTTP/1.0 200 OK\n";
|
||||
print "Content-Type: text/javascript\n\n";
|
||||
|
||||
print "var ticker = new Array();\n";
|
||||
print "ticker['price'] = $price;\n";
|
||||
print "ticker['volume'] = \"$volume\";\n";
|
||||
print "ticker['last'] = \"$last\";\n";
|
||||
|
||||
exit 0;
|
||||
Reference in new issue
Block a user