Tool / site for tracking offers?

Live forum: http://forum.freeipodguide.com/viewtopic.php?t=31920

mjgold

30-01-2006 23:38:24

Hi, can anyone recommend a tool or site for tracking which trials and offers you've signed up for?

Thanks!

Wolfeman

30-01-2006 23:40:01

A pad of paper and a pencil.

I use Outlook to track mine...

igneous

31-01-2006 06:47:18

I use excel

Gigante

31-01-2006 06:51:26

Excel here

darkscout

31-01-2006 09:41:14

[quote790b38ccd3="mjgold"]Hi, can anyone recommend a tool or site for tracking which trials and offers you've signed up for?

Thanks![/quote790b38ccd3]

PHP
http//exstatic.org/smtg/ydf.php/blah.jpg[" alt=""/img790b38ccd3]

ilanbg

31-01-2006 12:22:00

How does one go about using the PHP?

tylerc

31-01-2006 14:42:07

Excel.

hyperboarder

31-01-2006 14:43:28

The five sheets of paper pinned to the wall next to my head.

kevxross

31-01-2006 15:04:36

Excel works great.

phunkstar

31-01-2006 16:32:45

nm

igneous

31-01-2006 17:04:25

[quote8b7a7e9f6e="phunkstar"]Hey darkscout, I'd like a copy of that software if available. Thanks.[/quote8b7a7e9f6e]
php is code

Admin

31-01-2006 17:19:09

... so is software?

darkscout

31-01-2006 17:48:25

Change your .htaccessurl==http://=http:///url to read .gifurl==http://=http:///url files as PHP or add random stuff .gifurl==http://=http:///url onto the end of yfd.php to get it to work in the forums. (it doesn't accept .phpurl==http://=http:///url as a valid image)

http//yoursite.com/yfd.php/blah.gif

I am not your teacher, I am not a documentor. status.class.php works. you should only hahve to modify the other php.

This method requires your e-mail and password. Which is why I'm not hosting it.... unless you'd like to give me your e-mail and password. then I'd be GLAD to host... )

Why PHP? Because I'm the webmaster for a website with 12000+ lines of code. Everything you see was written in a few hours. I have a similar one written for freepay which tracks which offers I do. Mainly because I had too many excel files. One on my jump drive, on on my network drive, one on my home computer, etc. Keeping them synced was annoying. So I made a web interface.

I'm thinking of creating a login based website which will keep track of everything you do. You can add when you did an offer. Etc. it won't be auto magical like this... but who knows.


status.class.php
[code194e872cfb7]<?
class StatusCheck {
private $yfdList = array();
private $cache = 0;
private $cacheDir;
private $cacheTime;
public function __construct($cacheDir = NULL, $cacheTime = 60) {
if (isset($cacheDir)) {
$this->cache = 1;
$this->cacheTime = $cacheTimeli60;
if ($cacheDir[strlen($cacheDir) -1] == "/") {
$this->cacheDir = $cacheDir;
} else {
$this->cacheDir = $cacheDir."/";
}
}
if (isset($_ENV["TEMP"])) {
$this->cookiefile = $_ENV["TEMP"].rand(0,url==http://=http:///url 1000);
} else {
$this->cookiefile = "/tmp/".rand(0,url==http://=http:///url 1000);
}
@file_put_contents($this->cookiefile, "temporary");
}
public function __destruct() {
unlink($this->cookiefile);
}
/li Add Sites li/
public function addYFD($site, $email, $pass) {
array_push($this->yfdList, array('site'=>$site, 'email'=>$email, 'pass'=>$pass));
}
/li Read Cache or Get New Data li/
public function statusYFD($site, $email, $pass) {
if ($this->cache == 0) {
#echo "<!-- No Cache-->";
return $this->curlYDF($site, $email, $pass);
} elseif ($this->cache == 1) {
$file = $this->cacheDir.md5(base64_encode($site.$email.$pass));
if (file_exists($file)) {
$fileContents = file_get_contents($file);
$time = substr($fileContents, 0, 10);
$status = unserialize(trim(substr($fileContents, 10)));
if ($time<(time() -$this->cacheTime)) {
#echo "<!-- Out Dated. Refreshing Cache -->";
$status = $this->curlYDF($site, $email, $pass);
@file_put_contents($file, time() ."\n".serialize($status));url==http://=http:///url
return $status;
} elseif (!is_array($status)) {
#echo "<!-- Malformed File. Refreshing Cache -->";
$status = $this->curlYDF($site, $email, $pass);
@file_put_contents($file, time() ."\n".serialize($status));url==http://=http:///url
} else {
#echo "<!-- Reading Cache -->";

}
return $status;
} else {
#echo "<!-- No file. Refreshing Cache -->";
$status = $this->curlYDF($site, $email, $pass);
@file_put_contents($file, time() ."\n".serialize($status));url==http://=http:///url
return $status;
}
}
}
/li Curl & Grep Sites li/
public function curlYDF($site, $email, $pass) {
$email = urlencode($email);
$html = file_get_contents("http://$site/status_info.jsp?email=$email&password=$pass&submit=Login");
$statusReg = '/<tr[^>]li?>[^<]li?<td[^>]li?>[^<]li?<div[^>]li?>([^<]li?)<\/div>[^<]li?<\/td>[^<]li?<td[^>]li?>[^<]li?<div[^>]li?>([^<]li?)<\/div>[^<]li?<\/td>[^<]li?<td[^>]li?>[^<]li?<div[^>]li?>([^<]li?)<\/div>[^<]li?<\/td>[^<]li?<td[^>]li?>([^<]li?)<\/td>[^<]li?<[^>]li?>([^<]li?)<\/td>[^<]li?<\/tr>[^<]li?/';
preg_match_all($statusReg, $html, $statusMatch);
unset($statusMatch[0]);
unset($statusMatch[4]);
foreach($statusMatch[5] as $key=>$value) {
$statusMatch[5][$key] = trim($value);
}
$offerStatus = array();
foreach($statusMatch[2] as $index=>$offer) {
if (!array_key_exists($offer, $offerStatus)) {
$offerStatus[$offer] = $statusMatch[5][$index];
} elseif ($statusMatch[5][$index] == "In Progress") {
$offerStatus[$offer] = $statusMatch[5][$index];
}
}
$prizes = array_count_values($statusMatch[1]);
foreach($prizes as $key=>$value) {
if ($value = max(array_values($prizes))) {
$status['prize'] = $key;
}
}
if (strlen($status['prize']) >25) {
$tmp = explode(" ", $status['prize']);
$status['prize'] = "";
$i = 0;
do {
if (strlen($status['prize']." ".$tmp[$i]) <25) {
$status['prize'].= $status['prize']." ".$tmp[$i];
}
$i++;
}
while (strlen($status['prize']." ".$tmp[$i]) <25);
}
$status['prize']=trim($status['prize']);
foreach($statusMatch[3] as $key=>$value) {
$statusMatch[3][$key] = ceil((strtotime($value."+45 days") -time()) /(60li60li24));
}
$status['offer']['days'] = max(array_values($statusMatch[3]));
$status['offer']['pending'] = 0;
$status['offer']['inprogress'] = 0;
$status['offer']['approved'] = 0;
foreach($offerStatus as $offer) {
if ($offer == "Pending") {
$status['offer']['pending']++;
} elseif ($offer == "In Progress") {
$status['offer']['inprogress']++;
} elseif ($offer == "Approved") {
$status['offer']['approved']++;
}
}
return $status;
}
/li Print Site Table li/
public function printYFD() {
echo "<table class=\"table\">\n";
echo "<tr><th colspan=\"4\">yfdirect status</th></tr>\n";
echo "<tr><th>site</th><th colspan=\"3\">offer status</th></tr>\n";
echo "<tr><th>&nbsp;</th><th>pending</th><th>in progress</th><th>approved</th></tr>\n";
foreach($this->yfdList as $site) {
$status = $this->statusYFD($site['site'], $site['email'], $site['pass']);
echo "<tr><td>".$site['site']."</td><td>".$status['offer']['pending']."<td>".$status['offer']['inprogress']." (".$status['offer']['days']." days)</td><td>".$status['offer']['approved']."</td></tr>\n";
}
echo "</table><br>\n";
}
/li Print Status Images li/
public function imageYFD() {
foreach($this->yfdList as $index=>$site) {
$status = $this->statusYFD($site['site'], $site['email'], $site['pass']);
$i = 0;
$string[$index][$i] = "Site: ".$site['site'];
$i++;
$string[$index][$i] = " Prize: ".$status['prize'];
$i++;
$string[$index][$i] = " Pending: ".$status['offer']['pending'];
$i++;
$string[$index][$i] = "In Progress: ".$status['offer']['inprogress']." (".$status['offer']['days']." days)";
$i++;
$string[$index][$i] = " Approved: ".$status['offer']['approved'];
$i++;
$string[$index][$i] = "--------------";
}
$i = 0;
foreach($string as $site) {
foreach($site as $value) {
$stringsize[$i] = strlen($value);
$i++;
}
}
$max = max($stringsize);
$font = 3;
$radius = 10;
$height = 2li$radius+count($string) licount($string[0]) liimagefontheight($font);
$width = 2li$radius+imagefontwidth($font) limax($stringsize);
$radius = 10;
$img = imagecreate($width, $height);
$background = imagecolorallocate($img, 209, 215, 223);
imagecolortransparent($img, $background);
$black = imagecolorallocate($img, 0, 0, 0);
$this->ImageRectangleWithRoundedCorners($img, 0, 0, $width, $height, $radius, imagecolorallocate($img, 220, 230, 240));
$x = $radius;
$y = $radius;
foreach($string as $site) {
foreach($site as $row) {
imagestring($img, 3, $x, $y, $row, $black);
$y = $y+imagefontheight($font);
}
}
header('Content-Type: image/gif');
imagegif($img, '', 100);
imagedestroy($img);
}
public function ImageRectangleWithRoundedCorners(&$im, $x1, $y1, $x2, $y2, $radius, $color) {
// draw rectangle without corners
imagefilledrectangle($im, $x1+$radius, $y1, $x2-$radius, $y2, $color);
imagefilledrectangle($im, $x1, $y1+$radius, $x2, $y2-$radius, $color);
// draw circled corners
imagefilledellipse($im, $x1+$radius, $y1+$radius, $radiusli2, $radiusli2, $color);
imagefilledellipse($im, $x2-$radius, $y1+$radius, $radiusli2, $radiusli2, $color);
imagefilledellipse($im, $x1+$radius, $y2-$radius, $radiusli2, $radiusli2, $color);
imagefilledellipse($im, $x2-$radius, $y2-$radius, $radiusli2, $radiusli2, $color);
}
}
?>[/code194e872cfb7]

yfd.php
[code194e872cfb7]
<?
require ("status.class.php");
$status=new StatusCheck("/tmp/",36000);
$status->addYFD("everyfreegift.com","blah@blah.org","thisisnotmypassword");
$status->addYFD("bigwin.com","blah@blah.com","thisisnotmypassword");
$status->addYFD("internetopiniongroup.com","blah@blah.com","thisisnotmypassword");
$status->imageYFD();
?>
[/code194e872cfb7]

ajrock2000

31-01-2006 17:54:24

I wish my friggen hosting service would install PHP5. (

darkscout

31-01-2006 18:45:42

[quote708e190577="ajrock2000"]I wish my friggen hosting service would install PHP5. ([/quote708e190577]

I wish mine would install the curl libs. I have to host that on my cable connection. What particularly needs PHP5? I use it for fusioncash/freepay too. Which REQUIRE curl. But because yfd works as a GET (looks like someone forgot to turn register_globals off), i could get away with just requesting the website.

ajrock2000

31-01-2006 18:51:08

My hosting service is still on an early version of php4. It throws errors using the php5 object syntax (_construct, public, private, protected, _get, _set, etc). Very annoying. evil

ilanbg

31-01-2006 18:56:24

The above seems great but unfortunately I have no idea how to implement it. Anyone kind want to post a mini-tutorial as to how I'd set this up?

darkscout

31-01-2006 19:02:33

[quote8a41807441="ajrock2000"]My hosting service is still on an early version of php4. It throws errors using the php5 object syntax (_construct, public, private, protected, _get, _set, etc). Very annoying. evil[/quote8a41807441]

Ok. Stupid PHP4. delete the __construct __destruct and replace it with this.


[code18a41807441]public function StatusCheck($cacheDir = NULL, $cacheTime = 60) {
if (isset($cacheDir)) {
$this->cache = 1;
$this->cacheTime = $cacheTimeli60;
if ($cacheDir[strlen($cacheDir) -1] == "/") {
$this->cacheDir = $cacheDir;
} else {
$this->cacheDir = $cacheDir."/";
}
}
if (isset($_ENV["TEMP"])) {
$this->cookiefile = $_ENV["TEMP"].rand(0,url==http://=http:///url 1000);
} else {
$this->cookiefile = "/tmp/".rand(0,url==http://=http:///url 1000);
}
@file_put_contents($this->cookiefile, "temporary");
}
[/code18a41807441]

ajrock2000

31-01-2006 19:04:09

lol, I know how to fix it, you don't have to recode the thing. ;)

Especially since I can just run it on my localhost.

Thanks though, saved me some work I probably would have ended up doing myself.

darkscout

31-01-2006 19:04:26

[quote98687526dd="ilanbg"]The above seems great but unfortunately I have no idea how to implement it. Anyone kind want to post a mini-tutorial as to how I'd set this up?[/quote98687526dd]

Open wordpad. Put each piece of code into file named what the line above the code says.

Fix yfd.php to include your info, email, password, etc. All YFD sites should work. just include the site.com part the first part. (As long as they use the same HTML/site info.

Upload to host.

Enjoy.

CoMpFrEaK

31-01-2006 19:07:53

brain power lol

JUNIOR6886

31-01-2006 19:33:07

I use a simple word document in the following format

site, offer completed, length of trial, day i signed up, decision to keep

Notebooks4free.com tickle 7 days 5/13 CANCELED
(just an example not to say i really canceled)

srichter

31-01-2006 20:20:03

It breaks in PHP4 more than those functions; I had to hack it to get it to work. I'll post when I can be bothered to open an FTP client.

TheWorkGuy

31-01-2006 21:38:59

I just just a notebook, or just write on the TOS for each offer's site!

TWG

bruman

31-01-2006 21:40:36

Definetely FreebieAuthority Offer Trackerô
I dont know why people didnt mention them yet

http//www.freebieauthority.com/offer.php

Wolfeman

31-01-2006 21:46:10

http//www.freeoffersnow.net can help you keep track as well...

mr sparky

01-02-2006 16:56:46

I got this error

Parse error parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in status.class.php on line 3

Does that mean I don't have PHP5?

Airkat

01-02-2006 17:00:46

means if you don't know if you have php5 or not, and dont know how to tell, you should prolly get someone to do it for u

mr sparky

01-02-2006 17:51:30

Well the cpanel for my host only says "PHP installed" and does not show me a version. Since it was a different error from other people who only had PHP4 installed, I thought it is probably a different error.

srichter

01-02-2006 18:50:58

[code12ec265c02b]
<?php

require ("status.class.php");
$status= new statusCheck("/tmp/",2);

$status->addYFD("everyfreegift.com","EMAIL","AJAJAJAJAJAJA");

$status->printYFD();


?>
[/code12ec265c02b]

[code12ec265c02b]
<?

class statusCheck {

var $yfdList = array();
var $cookiefile;
var $cache = 0;
var $cacheDir;
var $cacheTime;

function statusCheck($cacheDir = NULL, $cacheTime = 60) {

if (isset($cacheDir)) {

$this->cache = 1;
$this->cacheTime = $cacheTimeli60;

if ($cacheDir[strlen($cacheDir) -1] == "/") {
$this->cacheDir = $cacheDir;
} else {
$this->cacheDir = $cacheDir."/";
}
}
}

/li Add Sites li/
function addYFD($site, $email, $pass) {
array_push($this->yfdList, array('site'=>$site, 'email'=>$email, 'pass'=>$pass));
}

/li Read Cache or Get New Data li/
function statusYFD($site, $email, $pass) {
return $this->curlYFD($site, $email, $pass);
}

/li Curl & Grep Sites li/
function curlYFD($site, $email, $pass) {
$email = urlencode($email);
$html = file_get_contents("http://$site/status_info.jsp?email=$email&password=$pass&submit=Login");
$statusReg = '/<tr[^>]li?>[^<]li?<td[^>]li?>[^<]li?<div[^>]li?>([^<]li?)<\/div>[^<]li?<\/td>[^<]li?<td[^>]li?>[^<]li?<div[^>]li?>([^<]li?)<\/div>[^<]li?<\/td>[^<]li?<td[^>]li?>[^<]li?<div[^>]li?>([^<]li?)<\/div>[^<]li?<\/td>[^<]li?<td[^>]li?>([^<]li?)<\/td>[^<]li?<[^>]li?>([^<]li?)<\/td>[^<]li?<\/tr>[^<]li?/';
preg_match_all($statusReg, $html, $statusMatch);

unset($statusMatch[0]);
unset($statusMatch[4]);
foreach($statusMatch[5] as $key=>$value) {
$statusMatch[5][$key] = trim($value);
}
$offerStatus = $statusMatch[5];
foreach($statusMatch[3] as $key=>$value) {
$statusMatch[3][$key] = ceil(((strtotime(substr($value,0,10))+3888000) -time()) /(60li60li24));
}
$status['offer']['days'] = max(array_values($statusMatch[3]));
$status['offer']['pending'] = 0;
$status['offer']['inprogress'] = 0;
$status['offer']['approved'] = 0;
foreach($offerStatus as $offer) {
if ($offer == "Pending") {
$status['offer']['pending']++;
} elseif ($offer == "In Progress") {
$status['offer']['inprogress']++;
} elseif ($offer == "Approved") {
$status['offer']['approved']++;
}
}
return $status;
}

/li Print Site Table li/
function printYFD() {
echo "<table class=\"table\" cellspacing=10>\n";
echo "<tr><th colspan=\"4\">yfdirect status</th></tr>\n";
echo "<tr><th>site</th><th colspan=\"3\">offer status</th></tr>\n";
echo "<tr><th>&nbsp;</th><th>pending</th><th>in progress</th><th>approved</th></tr>\n";
foreach($this->yfdList as $site) {
$status = $this->statusYFD($site['site'], $site['email'], $site['pass']);
echo "<tr><td>".$site['site']."</td><td>".$status['offer']['pending']."<td>".$status['offer']['inprogress']." (".$status['offer']['days']." days)</td><td>".$status['offer']['approved']."</td></tr>\n";
}
echo "</table><br>\n";
}

function imageYFD() {
foreach($this->yfdList as $index=>$site) {
$status = $this->statusYFD($site['site'], $site['email'], $site['pass']);
$i = 0;
$string[$index][$i] = "Site: ".$site['site'];
$i++;
$string[$index][$i] = " Prize: ".$status['prize'];
$i++;
$string[$index][$i] = " Pending: ".$status['offer']['pending'];
$i++;
$string[$index][$i] = "In Progress: ".$status['offer']['inprogress']." (".$status['offer']['days']." days)";
$i++;
$string[$index][$i] = " Approved: ".$status['offer']['approved'];
$i++;
$string[$index][$i] = "--------------";
}
$i = 0;
foreach($string as $site) {
foreach($site as $value) {
$stringsize[$i] = strlen($value);
$i++;
}
}
$max = max($stringsize);
$font = 3;
$radius = 10;
$height = 2li$radius+count($string) licount($string[0]) liimagefontheight($font);
$width = 2li$radius+imagefontwidth($font) limax($stringsize);
$radius = 10;
$img = imagecreate($width, $height);
$background = imagecolorallocate($img, 209, 215, 223);
imagecolortransparent($img, $background);
$black = imagecolorallocate($img, 0, 0, 0);
$this->ImageRectangleWithRoundedCorners($img, 0, 0, $width, $height, $radius, imagecolorallocate($img, 220, 230, 240));
$x = $radius;
$y = $radius;
foreach($string as $site) {
foreach($site as $row) {
imagestring($img, 3, $x, $y, $row, $black);
$y = $y+imagefontheight($font);
}
}
header('Content-Type: image/gif');
imagegif($img, '', 100);
imagedestroy($img);
}
function ImageRectangleWithRoundedCorners(&$im, $x1, $y1, $x2, $y2, $radius, $color) {
// draw rectangle without corners
imagefilledrectangle($im, $x1+$radius, $y1, $x2-$radius, $y2, $color);
imagefilledrectangle($im, $x1, $y1+$radius, $x2, $y2-$radius, $color);
// draw circled corners
imagefilledellipse($im, $x1+$radius, $y1+$radius, $radiusli2, $radiusli2, $color);
imagefilledellipse($im, $x2-$radius, $y1+$radius, $radiusli2, $radiusli2, $color);
imagefilledellipse($im, $x1+$radius, $y2-$radius, $radiusli2, $radiusli2, $color);
imagefilledellipse($im, $x2-$radius, $y2-$radius, $radiusli2, $radiusli2, $color);
}
}
?>
[/code12ec265c02b]

Be warned; I removed the cache part of it, it wasn't working and I couldn't be botehred to fix it.

ajrock2000

01-02-2006 19:38:09

Nice ) +karma.

darkscout

01-02-2006 20:54:34

[quotea71801ddd4="ajrock2000"]Nice ) +karma.[/quotea71801ddd4]

I see how it is. +karma for the redux version )

And I wouldn't suggest posting the image to anywhere public with out the cache, I'm not sure how YFD would like getting hit 1-2 times a second for a public forum.