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
find . -name .svn -print0 | xargs -0 rm -rf |
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 | |
$oldSetting = libxml_use_internal_errors( true ); | |
libxml_clear_errors(); | |
$html = new DOMDocument(); | |
$html->loadHtmlFile( 'http://www.makro.be/Content/assortiment/benzinestation/benzineprijzen/1/index.jsp?stat=0' ); | |
$xpath = new DOMXPath( $html ); | |
$nodelist = $xpath->query('//div[@class="boxContent"]/table/tr[last()]/td[last()]'); |
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
import lxml | |
import urllib | |
from lxml.html import fromstring | |
from lxml import etree | |
# vars | |
url = "http://www.makro.be/Content/assortiment/benzinestation/benzineprijzen/1/index.jsp?stat=0" | |
# methods |
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
#!/bin/sh | |
set -o errexit | |
nopass=0 | |
if [ $# -eq 0 ]; then | |
echo "-----> No parameters passed, assuming username 'root' and empty password" | |
DBS=`mysql -uroot -e "show databases;"` | |
nopass=1 |
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
; $Id: drupalconnect.info, v 0.1 $ | |
name = Drupal Connect | |
description = Provide a service for an external site | |
package = Custom modules | |
core = 6.x |
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 | |
/* | |
* Implementation of hook_disable() | |
* Perform necessary actions before module is disabled. (like clear the drupalconnect:methods cache) | |
*/ | |
function drupalconnect_disable() { | |
cache_clear_all('drupalconnect:methods', 'cache'); | |
} | |
/* | |
* Implementation of hook_enable() |
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 | |
/* | |
* Implementation of hook_service() | |
* Required by all server modules | |
* Returns array defining all the methods available in the service | |
*/ | |
function drupalconnect_service() { | |
return array( | |
array( |
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
<!DOCTYPE html> | |
<head> | |
<title>Drupalconnect frontend</title> | |
<style type="text/css"> | |
* { padding: 0; margin: 0; } | |
html { font-family: "Lucida grande", arial, sans-serif; color: #222;} | |
body { width: 800px; margin: 0 auto; } | |
h1 { margin: 80px 0; } | |
h3 { margin-bottom: 10px; } |
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 | |
// let's turn on error reporting | |
ini_set("display_errors", 1); | |
// include the XMLRPC library | |
// I used the one by keithdevens.com/software/xmlrpc | |
// You are free to use any library, but then the call will be different | |
// | |
// Note: this library has one big downside, it throws a lot of warnings in PHP 5, since | |
// it has some deprecated calls. I just hide warnings on my production site, so that was not |
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 // this php tag is only included for gist to detect the file and do syntax coloring :) | |
// Call default or custom access callback | |
if (call_user_func_array($method['access callback'], $access_arguments) != TRUE) { | |
return services_error(t('Access denied'), 401); | |
} |
OlderNewer