|
Post by Al Gobro on Jun 9, 2012 4:16:04 GMT -8
I'm aware that adfoc.us publicly announced that these errors will be fixed when they upgrade their database. But a month passed on the announcement and there have not been any developments on the issue since, according to the related thread.
These errors keep on being received by visitors, and I have noticed that sometimes situation persists more than a few minutes. As a result, our visitors probably judge our websites as sh*t. And this renders adfoc.us unreliable. As we don't know when exactly it will be fixed I need a solution. I don't want to divert my entire traffic permanently to an alternative shortener because adfoc.us pays good. So I ended up with following idea, not knowing if it will work, and how to do it:
I am not a programmer but I think its possible to place a javascript code on our websites in order to check if adfoc.us is running properly, and if not, replace adfoc.us links (easylinks) on our websites to an alternative (such as adfly) so that visitors don't get annoyed.
Can someone (including adfoc.us support) provide guidance on if its possible and how to do it?
|
|
|
Post by AdFoc.us on Jun 9, 2012 15:00:25 GMT -8
You will only see the gateway errors from the 6th to 7th of the month for a total of 1-2 hours (maximum) from now on while we are processing payments. In the next month, we'll be replacing that system with something better optimized so there should (hopefully) be no gateway errors during this time. That said, I am sure you can create a script to do this but I don't see the 1-2 hours per month as being worthwhile. php.net/manual/en/book.curl.php would be a good place to start
|
|
|
Post by Al Gobro on Jun 10, 2012 6:45:31 GMT -8
Thanks.
|
|
|
Post by fig2k4 on Jun 23, 2012 5:51:08 GMT -8
If you haven't already implemented this workaround, I came up with this today..
<?php function get_headers_curl($url) { $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 5);
return explode("\n", curl_exec($ch)); }
function get_http_response_code($url) { $headers = get_headers_curl($url); return explode(" ", $headers[0], 3); } ?>
Use it something like this..
<?php
$rc = get_http_response_code("http://adfoc.us/?refid=9713"); $use_ads = isset($rc[1]) && ($rc[1]==200);
if (!$use_ads) { ?>
|
|
|
Post by AdFoc.us on Jun 24, 2012 12:31:24 GMT -8
Nice work.
|
|