Created
November 6, 2010 04:41
-
-
Save KyleAMathews/665203 to your computer and use it in GitHub Desktop.
Create etherpad with this script
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
<?php | |
$padId = 'testingmoreplease'; | |
$domain = "http://piratepad.net"; | |
$ch = curl_init(); | |
# for debugging | |
curl_setopt($ch, CURLOPT_HEADER, true); | |
# parse cookies and follow all redirects | |
curl_setopt($ch, CURLOPT_COOKIEFILE, '/dev/null'); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
# first, post to get a cookie | |
curl_setopt($ch, CURLOPT_URL, $domain . '/ep/pad/create'); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, 'padId=' . urlencode($padId)); | |
$result = curl_exec($ch); | |
# next, post to actually create the etherpad | |
curl_setopt($ch, CURLOPT_URL, $domain . '/ep/pad/create'); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, 'padId=' . urlencode($padId)); | |
$result = curl_exec($ch); | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment