Drone Posted April 10, 2007 at 01:58 PM Report Share #92871 Posted April 10, 2007 at 01:58 PM Boas, Aqui está um snippet para ir buscar a foto de um utilizador ao HI5 Para tal basta ir ao http://dominio.pt/link_do_script.php?email=emaildosujeito@aqui.com $email = urldecode($_GET['email']); $referer = "http://google.pt"; $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $cookies = "cookies.txt"; $url = "http://hi5.com/friend/processNameSearch2.do"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies); $result = curl_exec ($ch); curl_close ($ch); $post = 'email='.$email.'&type=1&function=searchEmail&searchNew=1&submit2=Pesquisar'; $url = "http://hi5.com/friend/processNameSearch2.do"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies); $result = curl_exec ($ch); curl_close ($ch); preg_match_all("/<a href=\"(.*)\">/", $result, $userID); if (strlen($userID[0][4]) > 36) { echo $userID[0][4]; } else { echo "N/A"; } Link to comment Share on other sites More sharing options...
jreis Posted April 10, 2007 at 02:32 PM Report Share #92886 Posted April 10, 2007 at 02:32 PM Sim isso é mesmo a rebarbado...! :nono: Isso funciona bem...? ? "Pensa positivo: tudo pode piorar" Link to comment Share on other sites More sharing options...
Drone Posted April 10, 2007 at 02:45 PM Author Report Share #92896 Posted April 10, 2007 at 02:45 PM comigo funciona! Link to comment Share on other sites More sharing options...
vbmaster Posted April 10, 2007 at 03:07 PM Report Share #92903 Posted April 10, 2007 at 03:07 PM Not with me. Link to comment Share on other sites More sharing options...
Drone Posted April 10, 2007 at 05:32 PM Author Report Share #92942 Posted April 10, 2007 at 05:32 PM (edited) http://www.cursoDJ.com/curl/hi5.php?email=email@email.com Comigo funciona! o que vos aparece? Edited October 9, 2014 at 10:13 AM by Drone Link to comment Share on other sites More sharing options...
skin Posted April 10, 2007 at 06:20 PM Report Share #92957 Posted April 10, 2007 at 06:20 PM Eu alterei o campo email e apareceu um gajo mesmo bom... 😉 EDIT (para não spamar mais) Sim, funcionou comigo 😛 Our lives begin to end the day we become silent about things that matter - Martin Luther King Link to comment Share on other sites More sharing options...
Drone Posted April 10, 2007 at 07:52 PM Author Report Share #93015 Posted April 10, 2007 at 07:52 PM 😛 mas funcionou contigo não funcionou? Eu pus num outro HOST e funcionou também.. não percebo porque não deu contigo vbmaster, atenção que se utilizaste localmente tens de ter a cURL Lib instalada 🙂 Link to comment Share on other sites More sharing options...
ptrci Posted April 10, 2007 at 08:04 PM Report Share #93023 Posted April 10, 2007 at 08:04 PM comigo funciona Link to comment Share on other sites More sharing options...
Gurzi Posted April 12, 2007 at 06:28 PM Report Share #93365 Posted April 12, 2007 at 06:28 PM Porreiro, já ouvi falar muito do curl , vale a pena aprender isso ? é utilizado em que situações ? abraços Link to comment Share on other sites More sharing options...
Drone Posted April 13, 2007 at 09:09 PM Author Report Share #93619 Posted April 13, 2007 at 09:09 PM na minha opiniao cURL é muito porreiro, ouvi falar do cURL atraves de um script que tenho que é para importar os contactos do Hotmail, gmail, yahoo e afins... resumidamente e pelo que percebi cURL é como se fosse uma pessoa a visitar uma pagina, fazer login etc etc.. se é que me percebes, mas automaticamente claro 😄 pode-se fazer coisas engraçadas 🙂 Link to comment Share on other sites More sharing options...
ptrci Posted April 15, 2007 at 06:56 PM Report Share #93988 Posted April 15, 2007 at 06:56 PM Pus no meu alojamento e não funciona 😕 Link to comment Share on other sites More sharing options...
skin Posted April 15, 2007 at 06:57 PM Report Share #93989 Posted April 15, 2007 at 06:57 PM @ptrci Provávelmente o teu host não tem o Curl instalado. :dontgetit: DependênciasPara poder usar as funções CURL você precisa instalar o pacote CURL. PHP requer que você use o CURL 7.0.2-beta ou posterior. PHP não irá funcionar com qualquer versão anterior a CURL 7.0.2-beta. No PHP 4.2.3, você precisa do CURL versão 7.9.0 ou posterior. A partir do PHP 4.3.0, você precisa da CURL versão que seja 7.9.8 ou posterior. PHP 5.0.0 irá precisar provavelmente da CURL versão posterior a 7.10.5 Our lives begin to end the day we become silent about things that matter - Martin Luther King Link to comment Share on other sites More sharing options...
ptrci Posted April 15, 2007 at 06:58 PM Report Share #93990 Posted April 15, 2007 at 06:58 PM Já funciona. tinha feito um erro. Link to comment Share on other sites More sharing options...
ptrci Posted April 28, 2007 at 04:02 PM Report Share #96455 Posted April 28, 2007 at 04:02 PM Estou a tentar criar um formulário, onde insiro o e-mail e ele vai pesquisar. Mas não consigo. Porque ele não reconhece os caracteres @ e ? . 😄 Link to comment Share on other sites More sharing options...
Romanovs Posted April 28, 2007 at 08:40 PM Report Share #96539 Posted April 28, 2007 at 08:40 PM experimenta, meter uma caixa de texto para o inicio outro para o servidor e outro para o dominio separadas respectivamente pelo "@" e o "." e viva o desenrascanço 😄 Link to comment Share on other sites More sharing options...
_deXter Posted April 28, 2007 at 09:19 PM Report Share #96551 Posted April 28, 2007 at 09:19 PM Está engraçado. 😄 http://www.cursoDJ.com/curl/hi5.php?email=dronept@hotmail.com Comigo funciona! o que vos aparece? Já agora, quando encontra o link da imagem no teu alojamento está algo como: http://www.cursodj.com/friend/profile/displayProfile.do?userid=blabla , podias corrigir isso. 😛 Link to comment Share on other sites More sharing options...
Drone Posted April 30, 2007 at 07:27 PM Author Report Share #97050 Posted April 30, 2007 at 07:27 PM ya... mas isso é pa testes... o principal é obter o ID de Hi5 👍 Link to comment Share on other sites More sharing options...
ville Posted May 6, 2007 at 05:28 PM Report Share #98632 Posted May 6, 2007 at 05:28 PM Eu nao percebo nada do curl, mas corrijam-me se tiver errado; Se o hi5 mudar o layout da pagina, pode ser que o script deixe de funcionar, n é? Link to comment Share on other sites More sharing options...
Drone Posted May 7, 2007 at 08:14 PM Author Report Share #98872 Posted May 7, 2007 at 08:14 PM sim é provavel que nao funcione, assim que deixar de funcionar tens de verificar o que foi alterado no Hi5 😉 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now