Доработка скрипта для статуса вконтакте

Discussion in 'PHP' started by SPrivate, 9 Mar 2009.

  1. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    del
     
    #1 SPrivate, 9 Mar 2009
    Last edited: 10 Mar 2009
  2. Pashkela

    Pashkela Динозавр

    Joined:
    10 Jan 2008
    Messages:
    2,750
    Likes Received:
    1,044
    Reputations:
    339
    $text = '
    Друзей онлайн:

    '.$stat.'


    ';

    кавычки посчитай
     
  3. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    заменил на
    Теперь
     
  4. Pashkela

    Pashkela Динозавр

    Joined:
    10 Jan 2008
    Messages:
    2,750
    Likes Received:
    1,044
    Reputations:
    339
    $text = "Друзей онлайн: $stat";
     
  5. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    в 5 строке таже ошибка
     
  6. awdrg

    awdrg Member

    Joined:
    30 Jan 2009
    Messages:
    195
    Likes Received:
    31
    Reputations:
    1
    честно?
     
  7. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    Pashkela, стукни плиз 554908
     
  8. Pashkela

    Pashkela Динозавр

    Joined:
    10 Jan 2008
    Messages:
    2,750
    Likes Received:
    1,044
    Reputations:
    339
    чото сыкотно мне, еще уведешь асю
     
  9. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    да хватит дрочиться)) лучше помоги))
     
  10. [dei]

    [dei] Active Member

    Joined:
    24 Nov 2008
    Messages:
    171
    Likes Received:
    112
    Reputations:
    5
    поставь редактор с подсветкой синтаксиса
     
  11. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    del
     
    #11 SPrivate, 10 Mar 2009
    Last edited: 10 Mar 2009
  12. Pashkela

    Pashkela Динозавр

    Joined:
    10 Jan 2008
    Messages:
    2,750
    Likes Received:
    1,044
    Reputations:
    339
    $url = 'http://vkontakte.ru/friend.php?act=online&id='.$id;
     
  13. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    Теперь всё пашет но не выводит в статус кол-во((( в чем трабла??
     
  14. Pashkela

    Pashkela Динозавр

    Joined:
    10 Jan 2008
    Messages:
    2,750
    Likes Received:
    1,044
    Reputations:
    339
    Да хз, не могу проверить, не регюсь на стрёмных ФСБ-шных ресурсах, в принципе
     
  15. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    да там уже дан акк в сорцах))
     
  16. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    в чем трабла?? помогите))
     
  17. Kaimi

    Kaimi Well-Known Member

    Joined:
    23 Aug 2007
    Messages:
    1,732
    Likes Received:
    811
    Reputations:
    231
    Попробуй
    PHP:
    <?

    $id '123456';
    $email '[email protected]';
    $pass 'test';
    $remixsid '.....';

    $ck 'remixmid='.$id.'; remixemail='.urlencode($email).'; remixpass='.md5($pass).'; remixsid='.$remixsid;

    $data socket_do('vkontakte.ru'0'/id'.$id'Firefox'$ck1'GET'''100);
    preg_match("/act=online(.{1,40})\((\d+)\)<\/a>/"$data$ret);
    $online $ret[2];
    preg_match("/activityhash' value='(\S{32})'/"$data$ret);
    $hash $ret[1];

    socket_do('vkontakte.ru'"setactivity=".surlenc(to_unicode('Друзей онлайн: ')).$online."&activityhash=".$hash'/id'.$id'Firefox'$ck1'POST'''100);


    function 
    to_unicode($text,$from='w')
    {
      
    $text=convert_cyr_string($text,$from,'i');
      
    $uni='';

      for(
    $i=0$len=strlen($text); $i<$len$i++)
      {
        
    $char=$text{$i};
        
    $code=ord($char);
        
    $uni.=($code>175) ? "&#".(1040+($code-176)).";" $char;
      }

      return 
    $uni;
    }

    function 
    surlenc($msg)
    {
      
    $msg=str_replace(array('%','&','+','?'),array('%25','%26','%2B','%3F'),$msg);
      return 
    $msg;
    }

    function 
    socket_do($host,$vars,$service_uri,$browser,$cookies='',$sread=1,$method='POST',$ref='',$addheaders=1,$proxy=false,$proxyport=0,$HTTP='1.0')
    {
      
    $ret="";

      if(
    $method=='GET' && $vars)
      {
        
    $service_uri.='?'.$vars;
        
    $vars='';
      }

      
    $header="Host: $host\r\n";
      
    $header.="User-Agent: $browser\r\n";

      if(
    $addheaders==1)
      {
        
    $header.="Content-Type: application/x-www-form-urlencoded\r\n";
        
    $header.="Content-Length: ".strlen($vars)."\r\n";
      }
      else if(
    $addheaders==0)
      {
        
    $header.="Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
        
    $header.="Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3\r\n";
        
    $header.="Accept-Encoding: \r\n";
        
    $header.="Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7\r\n";
      }
      else if(
    $addheaders==2)
      {
        
    $header.="Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
        
    $header.="Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3\r\n";
        
    $header.="Accept-Encoding: \r\n";
        
    $header.="Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7\r\n";
        
    $header.="Pragma: no-cache\r\n";
        
    $header.="Cache-Control: no-cache\r\n";
        
    $header.="Content-Length: ".strlen($vars)."\r\n";
        
    $header.="Content-Type: application/x-www-form-urlencoded; charset=windows-1251\r\n";
      }
      else if(
    $addheaders==3)
      {
        
    $header.="Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
        
    $header.="Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3\r\n";
        
    $header.="Accept-Encoding: gzip,deflate\r\n";
        
    $header.="Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7\r\n";
      }


      if(
    $ref$header.="Referer: $ref\r\n";

      
    $header.="Connection: close\r\n";

      if(
    $cookies)
        
    $header.="Cookie: $cookies\r\n";

      
    $header.="\r\n";


      if(
    $proxy)
      {
        
    $addquery="$method http://$host$service_uri  HTTP/$HTTP\r\n";
        
    $fp=fsockopen("tcp://".$proxy,$proxyport,$errno,$errstr,30);
      }
      else
      {
        
    $addquery="$method $service_uri  HTTP/$HTTP\r\n";
        
    $fp=fsockopen("tcp://".$host,80,$errno,$errstr,30);
      }

      
    stream_set_timeout($fp,30);

      if(!
    $fp)
      {
        print 
    "addMes('<font color=red>Socket error: <i>$errstr ($errno)</i></font><br>');nextAcc();";
        exit();
      }



      
    fputs($fp,$addquery);
      
    fputs($fp,$header.$vars);


      if(
    $sread)
      {
        while(!
    feof($fp))
        {
          
    $ret.=fgets($fp128);
        }
      }

      
    fclose($fp);



      return 
    $ret;
    }
    ?> 
     
    _________________________
  18. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    пишит
     
  19. Kaimi

    Kaimi Well-Known Member

    Joined:
    23 Aug 2007
    Messages:
    1,732
    Likes Received:
    811
    Reputations:
    231
    Форум пробел поставил
     
    _________________________
  20. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    Kaimi, Спасибо огромное))