Skip to content

Instantly share code, notes, and snippets.

View parsidea's full-sized avatar

parsidea parsidea

View GitHub Profile
@jonhattan
jonhattan / thingie2drupal.php
Created June 4, 2013 08:28
PHP script using curl to login to a website using POST, store the cookie and request pages subsequently. The script also provides placeholders to parse data from a page and create a node in Drupal. It is intended to be used as a drush script (drush php-script --script-path=/path/to/script/folder thingie2drupal)
<?php
$URL = 'http://example.com/login.php';
$user = 'USER';
$pass = 'PASS';
$cookie_path = dirname(__FILE__).'/cookie.txt';
/**
* Hace login en la web enviando un POST con el usuario y contraseña.