Thanks, appreciate it.

On Jan 8, 12:16 pm, creecode <creec...@gmail.com> wrote:
> Hello Stodge,
>
> It seems a bit convoluted on the command line but in reallity not much more
> convoluted if you consider all that a browser does for us in this regard.
> :-)
>
> I've used a similar technique to the one you describe on my Crowdsourcing
> Nutrition Facts website.  Here is an extract from the 
> documentation<%20http://www.crowdsourcingnutritionfacts.info/about/#rest-api-authentic...>
> ...
>
> Get the login webpage and parse the csrf token into the data shell
> variable.
>
> $ data=$(curl -s -c 
> cookies.txthttp://www.crowdsourcingnutritionfacts.info/accounts/login/| grep 
> -o "name=['\"]csrfmiddlewaretoken['\"] value=['\"][^'\"]*" | sed -e 
> "s/name='//" -e "s/' value='/=/")\&username=*user name*\&password=*password*
>
>  Log in to the website.
>
> $ curl -b cookies.txt -c cookies.txt -d $data -X POST -H 'Content-Type: 
> application/x-www-form-urlencoded'http://www.crowdsourcingnutritionfacts.info/accounts/login/
>
>  Get brands containing the search term "ea".
>
> $ curl -b 
> cookies.txthttp://www.crowdsourcingnutritionfacts.info/api/auto-complete/brand/?...
>
> This is not a best practices or anything just a sample to show programmers
> the mechanics of interacting with the website with whatever tools they
> choose to use.  I attempted to use tools that I thought would be
> available/familiar to a wide variety of systems/programmers.
>
> Toodle-loooooooooooo...............
> creecode

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to