Skip to content

Instantly share code, notes, and snippets.

@kroger
Created June 20, 2011 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kroger/1035949 to your computer and use it in GitHub Desktop.
Save kroger/1035949 to your computer and use it in GitHub Desktop.
Baixa lattes
#!/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