Created
June 20, 2011 16:32
-
-
Save kroger/1035949 to your computer and use it in GitHub Desktop.
Baixa lattes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
initfile=~/.lattesrc | |
tmpdir=/tmp | |
function parse_init { | |
if [ -f $initfile ] | |
then | |
source $initfile | |
else | |
echo "Arquivo ~/.lattesrc não existe, por favor crie um arquivo com os dados:" | |
echo "usuario=<seu usuario>" | |
echo "senha=<sua senha>" | |
exit | |
fi | |
} | |
function site_login { | |
curl -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" \ | |
-d "sub=Confirma&opcao=lattes&cpf=${cpf}&senha=${senha}" \ | |
-k \ | |
-b "imp=cnpqrestritos ; path=/; domain=.cnpq.br" \ | |
-c $tmpdir/cookie.txt\ | |
-o $tmpdir/login.html \ | |
"https://wwws.cnpq.br/sigef_imp/owa/pservicos.entrada" | |
} | |
function baixa_pagina { | |
curl -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" \ | |
-e "http://plsql1.cnpq.br/curriculo/pkg_menu.menu?f_cod=${id}" \ | |
-c $tmpdir/cookie.txt -b $tmpdir/cookie.txt \ | |
-o lattes.zip \ | |
"http://plsql1.cnpq.br/curriculo/pkg_xml.recupera_xml_cv?f_cod=${id}" | |
} | |
parse_init && site_login && baixa_pagina |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment