|
|
View previous topic :: View next topic |
Author |
Message |
oramarin
Posts: 3
|
Posted: Mon Feb 15, 2010 1:53 pm Post subject: curl, wget & acquired data |
|
|
I know has kind have been discussed before but I haven't found the answer
I am want to update the acquired data of a show in a bash script.
to do so I use curl ton fetch a cookies of a logged session on myepisodes.com
Code: |
curl --cookie-jar /tmp/myepisodes --data "username=XXXX&password=XXXXXX&action=Login" http://www.myepisodes.com/login.php
|
when I see the cookie is seams ok.
then I use it to update my show
Code: |
curl --cookie /tmp/myepisodes "http://myepisodes.com/myshows.php?action=Update&showid=XXX&season=X&episode=XX&seen=0"
|
But It doesn't work, I seems not to be logged in
And of course it works when I do it in in my favorite browser
I saw that some of you done it in PHP with curl
anyone has a something to share ?
Thanks |
|
Back to top |
|
|
paddycarey
Posts: 2
|
Posted: Wed Feb 17, 2010 12:12 pm Post subject: |
|
|
I've also been trying to figure this out recently, I can manage to get the cookie by using your first curl command above and i can succesfully use it to show my all-in-one page using the command:
Code: | curl -b /tmp/myepisodes 'http://www.myepisodes.com/myshows.php' |
But trying to mark anything as acquired or watched redirects me to the login page, curl seems to think it's not logged in. I dont understand why one page works but not the other, I need to be logged in to see either page, no?
Any help would be greatly appreciated.
Cheers,
Paddy |
|
Back to top |
|
|
oramarin
Posts: 3
|
Posted: Wed Feb 17, 2010 12:47 pm Post subject: |
|
|
I have found a temporary solution:
I use php with php-curl to run the part of the script that was done for the rutv script
Big thanks to aoeuhtns by the way !!!
My bash script build for each episode a php file that he execute.
Quik & dirty i know ! but it works !
here is the php file that is generated:
Code: |
<?php
if ( ! isset($curlConn) ) {
$curlConn = curl_init();
curl_setopt($curlConn, CURLOPT_URL, 'http://myepisodes.com/login.php');
curl_setopt($curlConn, CURLOPT_POST, 1);
curl_setopt($curlConn, CURLOPT_POSTFIELDS, array('username'=>'xxxxxx','password'=>'xxxxxxxxx','action'=>'Login'));
curl_setopt($curlConn, CURLOPT_HEADER, 1);
curl_setopt($curlConn, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlConn, CURLOPT_COOKIEFILE, '/var/tmp/myepisodes' );
curl_setopt($curlConn, CURLOPT_COOKIEJAR, '/var/tmp/myepisodes' );
echo(curl_exec($curlConn));
}
$touchUrl = 'http://myepisodes.com/myshows.php?action=Update&showid=5136&season=1&episode=13&seen=0';
curl_setopt($curlConn, CURLOPT_POST, 0);
curl_setopt($curlConn, CURLOPT_URL, $touchUrl);
curl_setopt($curlConn, CURLOPT_RETURNTRANSFER, 1);
$touch_results = curl_exec($curlConn);
?>
|
note that my bash script generate the proper line for:
Code: |
$touchUrl = 'http://myepisodes.com/myshows.php?action=Update&showid=5136&season=1&episode=13&seen=0';
|
but I am still interested how to make this work just with curl
Thanks in advance for your help
oramarin |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
Main design by MW. Refitted to board by Hostile.
|