Skip to content

Instantly share code, notes, and snippets.

@Cellane
Created January 11, 2011 12:46
Show Gist options
  • Save Cellane/774365 to your computer and use it in GitHub Desktop.
Save Cellane/774365 to your computer and use it in GitHub Desktop.
<?php
$login = "ENTER EMAIL ADDRESS HERE";
$password = "ENTER PASSWORD HERE";
$site_url = "http://reformedstrategy.guildlaunch.com";
$login_url = "https://reformedstrategy.guildlaunch.com/recruiting/login.php?gid=54449";
$feed_url = "http://reformedstrategy.guildlaunch.com/feeds/forums/?mode=last_forum_posts&gid=54449";
$cookie_name = "cookies/". $login ."-cookie.txt";
$post_vars = "action=li2Login&loginEmail=". $login ."&loginPassword=". $password ."&submit=true";
$fp = fopen ($cookie_name, "w");
fclose ($fp);
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie_name);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie_name);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_TIMEOUT, 40);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_vars);
curl_setopt ($ch, CURLOPT_HEADER, true);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_REFERER, $site_url);
curl_setopt ($ch, CURLOPT_URL, $login_url);
$output = curl_exec ($ch);
curl_close ($ch);
unset ($ch);
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie_name);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_URL, $feed_url);
$output = curl_exec ($ch);
curl_close ($ch);
unset ($ch);
header ("Content-Type: application/rss+xml");
echo ($output);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment