Sonntag, 13. Juni 2010

PHP gemerkt

PHP gemerkt


=ROUND($C$1*C10,-1.0)  runden auf volle zehner, bzw. -1 stelle nach dem komma

=ROUND($C$1*C10,0) runden auf volle Einer



Umlaute- Problem beim Email mittels PHP mail()

Kaputte Umlaute im Betreff (Subject) und Inhalt (Body) mit der Funktion mail(), vor allem, wenn die Mails per SMTP abgeholt werden

$header = "From: Ronnie James Dio <".$from_email.">\n";
$header .= "Reply-To: ".$replyemail."\n";
$header .= 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable' . "\r\n";
$subject = '=?utf-8?b?'.base64_encode($subject).'?=';

mail($to_email, $subject, $message, $header);



in modx:

save_web_user.processor.php, save_user.processor.php 

// in case any plugins include a quoted_printable function
function save_user_quoted_printable($string) {
$crlf = "\n" ;
$string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string) . $crlf ;
$f[] = '/([\000-\010\013\014\016-\037\075\177-\377])/e' ;
$r[] = "'=' . sprintf('%02X', ord('\\1'))" ; $f[] = '/([\011\040])' . $crlf . '/e' ;
$r[] = "'=' . sprintf('%02X', ord('\\1')) . '" . $crlf . "'" ;
$string = preg_replace($f, $r, $string) ;
return trim(wordwrap($string, 70, ' =' . $crlf)) ;
}

// Send an email to the user
function sendMailMessage($email, $uid, $pwd, $ufn) {


global $websignupemail_message;
global $emailsubject, $emailsender;
global $site_name, $site_start, $site_url;
$message = sprintf($websignupemail_message, $uid, $pwd); // use old method
// replace placeholders
$message = str_replace("[+uid+]", $uid, $message);
$message = str_replace("[+pwd+]", $pwd, $message);
$message = str_replace("[+ufn+]", $ufn, $message);
$message = str_replace("[+sname+]", $site_name, $message);
$message = str_replace("[+saddr+]", $emailsender, $message);
$message = str_replace("[+semail+]", $emailsender, $message);
$message = str_replace("[+surl+]", $site_url, $message);
$headers = "From: " . $emailsender . "\r\n";
$headers .= "X-Mailer: Content Manager - PHP/" . phpversion();
$headers .= "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
$headers .= "Content-Transfer-Encoding: quoted-printable\r\n";
$subject = "=?UTF-8?Q?".$emailsubject."?=";
$message = save_user_quoted_printable($message);

if (ini_get('safe_mode') == FALSE) {
if (!mail($email, $subject, $message, $headers, "-f $emailsender")) {
webAlert("$email - {$_lang['error_sending_email']}");
exit;
}
} elseif (!mail($email, $subject, $message, $headers)) {
webAlert("$email - {$_lang['error_sending_email']}");
exit;
}
}




class.phpmailer.php

class PHPMailer
{
    /////////////////////////////////////////////////
    // PUBLIC VARIABLES
    /////////////////////////////////////////////////

    /**
     * Email priority (1 = High, 3 = Normal, 5 = low).
     * @var int
     */
    var $Priority          = 3;

    /**
     * Sets the CharSet of the message.
     * @var string
     */
    //var $CharSet           = "iso-8859-1";
    var $CharSet           = "utf-8";
   

    /**
     * Sets the Content-type of the message.
     * @var string
     */
    var $ContentType        = "text/plain";

    /**
     * Sets the Encoding of the message. Options for this are "8bit",
     * "7bit", "binary", "base64", and "quoted-printable".
     * @var string
     */
    var $Encoding          = "8bit";


/assets/snippets/weblogin/weblogin.processor.inc.php

# process password reminder
    if ($isPWDReminder==1) {
        $email = $_POST['txtwebemail'];
        $webpwdreminder_message = $modx->config['webpwdreminder_message'];
        $emailsubject = $modx->config['emailsubject'];
        $emailsender = $modx->config['emailsender'];
        $site_name = $modx->config['site_name'];
        // lookup account
        $sql = "SELECT wu.*, wua.fullname
                FROM $dbase.`".$table_prefix."web_users` wu
                INNER JOIN $dbase.`".$table_prefix."web_user_attributes` wua ON wua.internalkey=wu.id
                WHERE wua.email='".$modx->db->escape($email)."'";

        $ds = $modx->db->query($sql);
        $limit = $modx->recordCount($ds);
        if($limit==1) {
            $newpwd = webLoginGeneratePassword(8);
            $newpwdkey = webLoginGeneratePassword(8); // activation key
            $row = $modx->fetchRow($ds);
            //save new password
            $sql="UPDATE $dbase.`".$table_prefix."web_users`
                  SET cachepwd='".$newpwd."|".$newpwdkey."'
                  WHERE id=".$row['id'];
            $modx->db->query($sql);
            // built activation url
            $xhtmlUrlSetting = $modx->config['xhtml_urls'];
            $modx->config['xhtml_urls'] = false;
            if($_SERVER['SERVER_PORT']!='80') {
              $url = $modx->config['server_protocol'].'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$modx->makeURL($modx->documentIdentifier,'',"webloginmode=actp&wli=".$row['id']."&wlk=".$newpwdkey);
            } else {
              $url = $modx->config['server_protocol'].'://'.$_SERVER['SERVER_NAME'].$modx->makeURL($modx->documentIdentifier,'',"webloginmode=actp&wli=".$row['id']."&wlk=".$newpwdkey);
            }
            $modx->config['xhtml_urls'] = $xhtmlUrlSetting;
            // replace placeholders and send email
            $message = str_replace("[+uid+]",$row['username'],$webpwdreminder_message);
            $message = str_replace("[+pwd+]",$newpwd,$message);
            $message = str_replace("[+ufn+]",$row['fullname'],$message);
            $message = str_replace("[+sname+]",$site_name,$message);
            $message = str_replace("[+semail+]",$emailsender,$message);
            $message = str_replace("[+surl+]",$url,$message);
//Rainer
$headers = "From: " . $emailsender . "\r\n";
$headers .= "X-Mailer: Content Manager - PHP/" . phpversion();
$headers .= "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
$headers .= "Content-Transfer-Encoding: quoted-printable\r\n";
$subject = "=?UTF-8?Q?".$emailsubject."?=";
$message = save_user_quoted_printable($message);
//$emailsubject = '=?utf-8?b?'.base64_encode("Neue Passwortbestätigung für $site_name").'?=';
$emailsubject = '=?utf-8?b?'.base64_encode("Neue Passwortbestätigung für $site_name").'?=';
           //if (!ini_get('safe_mode')) $sent = mail($email, "New Password Activation for $site_name", $message, "From: ".$emailsender."\r\n"."X-Mailer: MODx Content Manager - PHP/".phpversion(), "-f {$emailsender}");
            //else $sent = mail($email, "New Password Activation for $site_name", $message, "From: ".$emailsender."\r\n"."X-Mailer: MODx Content Manager - PHP/".phpversion());
            if (!ini_get('safe_mode')) $sent = mail($email, $emailsubject, $message, $headers, "-f {$emailsender}");
            else $sent = mail($email, $emailsubject, $message, $headers);
            if(!$sent) {
                // error
                //$output =  webLoginAlert("Error while sending mail to $email. Please contact the Site Administrator");
                $output =  webLoginAlert("Fehler beim Sender der Email an $email. Bitte kontaktieren Sie den Administrator");
                return;
            }
            //if(!$pwdReqId) $output = webLoginAlert("Please check your email account ($email) for login instructions.");
            if(!$pwdReqId) $output = webLoginAlert("Bitte prüfen Sie Ihren Emailaccount ($email). Dort finden Sie Login-Infos.");
            else {
                // redirect to password request notification page
                $url = $modx->makeURL($pwdReqId);
                $modx->sendRedirect($url,0,'REDIRECT_REFRESH');
            }
        }
        else {
            //$output = webLoginAlert("We are sorry! We cannot locate an account using that email.");
            $output = webLoginAlert("Leider gibt es keinen Account, der diese Emailadresse benutzt.");
        }

        return;

    }




/assets/snippets/weblogin/weblogin.common.inc.php

    // Send new password to the user
    function webLoginSendNewPassword($email,$uid,$pwd,$ufn){
        global $modx, $site_url;
        $mailto = $modx->config['mailto'];
        $websignupemail_message = $modx->config['websignupemail_message'];    
        $emailsubject = $modx->config['emailsubject'];
        $emailsender = $modx->config['emailsender']; 
        $site_name = $modx->config['site_name'];
        $site_start = $modx->config['site_start'];
        $message = sprintf($websignupemail_message, $uid, $pwd); // use old method
        // replace placeholders
        $message = str_replace("[+uid+]",$uid,$message);
        $message = str_replace("[+pwd+]",$pwd,$message);
        $message = str_replace("[+ufn+]",$ufn,$message);
        $message = str_replace("[+sname+]",$site_name,$message);
        $message = str_replace("[+semail+]",$emailsender,$message);
        $message = str_replace("[+surl+]",$site_url,$message);
//Rainer



$headers = "From: " . $emailsender . "\r\n";
$headers .= "X-Mailer: Content Manager - PHP/" . phpversion();
$headers .= "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
$headers .= "Content-Transfer-Encoding: quoted-printable\r\n";
$subject = "=?UTF-8?Q?".$emailsubject."?=";
//$message = save_user_quoted_printable($message);

        if (!ini_get('safe_mode')) $sent = mail($email, $emailsubject, $message, $headers, "-f {$emailsender}");
        else $sent = mail($email, $emailsubject, $message, $headers);
        if (!$sent) webLoginAlert("Error while sending mail to $mailto",1);
        return true;
    }

/*
// in case any plugins include a quoted_printable function
function save_user_quoted_printable($string) {
$crlf = "\n" ;
$string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string) . $crlf ;
$f[] = '/([\000-\010\013\014\016-\037\075\177-\377])/e' ;
$r[] = "'=' . sprintf('%02X', ord('\\1'))" ; $f[] = '/([\011\040])' . $crlf . '/e' ;
$r[] = "'=' . sprintf('%02X', ord('\\1')) . '" . $crlf . "'" ;
$string = preg_replace($f, $r, $string) ;
return trim(wordwrap($string, 70, ' =' . $crlf)) ;
}
*/

Montag, 26. April 2010

XTC Gemerkt

XTC Gemerkt
xt:commerce 3.04 SP2.1



1.  ..................................................................................
Problem mit xtc Add-On, Modul: Erweiterter import/export:

Für einen Artikel sollen mehrere Bilder hochgeladen werden. 
Option weitere Zusatzbilder ist eingestellt und die Bilder befinden sich im Verzeichnis /images/product_images/orginal_images/. 
Leider wird nur ein Bild aktualisiert (p_image). Die Bilder unter p_image.1 und p_image.2 usw. werden nicht angezeigt. 
Wenn  die Bilder im Admin hochgeladenb werden, funktioniert es. 


Lösung:
admin/includes/classes/import.php in generate_map()


ändere 
                // product images
                for ($i = 1; $i < MO_PICS + 1; $i ++) {
                    $file_layout = array_merge($file_layout, array ('p_image.'.$i => '')); 
in
// BOF - Rainer Schamel
                // product images
                //for ($i = 1; $i < MO_PICS + 1; $i ++) {
                //    $file_layout = array_merge($file_layout, array ('p_image.'.$i => ''));
                //}
// insert images
for ($i = 1; $i < MO_PICS + 1; $i ++) {
if (isset($dataArray['p_image.'.$i]) && $dataArray['p_image.'.$i]!="") {
// check if entry exists
if ($this->checkImage($i,$products_id)) {
$insert_array = array ('image_name' => $dataArray['p_image.'.$i]);
xtc_db_perform(TABLE_PRODUCTS_IMAGES, $insert_array, 'update', 'products_id = \''.$products_id.'\' and image_nr=\''.$i.'\'');
} else {
$insert_array = array ('image_name' => $dataArray['p_image.'.$i],'image_nr'=>$i,'products_id'=>$products_id);
xtc_db_perform(TABLE_PRODUCTS_IMAGES, $insert_array);
}
}
}
// EOF - Rainer Schamel

Samstag, 24. April 2010

Eclipse Tastatur versehentlich umgest...

Chrome oder Eclipse Tastatur versehentlich umgestellt

geht rückgängig zu machen mit dem Shortcut: Alt+Shift


wenn du es aus Versehen umgestellt hast, drücke mal linke Alt + Umschalttaste gleichzeitig.

Dienstag, 13. April 2010

ASCII Datei splitten

Datei Splitten: ASCII Datei ist 1GB groß und muß aufgeteilt werden
Mit Linux split wird die Datei in zwei 500MB Dateien aufgeteilt

split -b 1000000b Modell.stl Modell.part_

Löschen ohne Nachfrage:
rm -rf Modell.part_*

Dienstag, 9. Februar 2010

Webroboter

Webroboter a la ct 


Ruby und mechanics



Install ruby mit gems und mechanics:

http://rubyinstaller.org, ruby dem Path hinzufügen lassen, 
prüfen mit ruby -v

gem install mechanize



###MyGoogleSearch.rb###
require 'rubygems'
require 'mechanize'

agent = WWW::Mechanize.new
puts ".........Mapsergebnisse................"
agent.page.forms.first.as_q = 'pfandleihhaus'
agent.page.forms.first.submit
Maps_links = agent.page.search('h4[@class="r"]/a[@class="l"]')
#links.each{|link| puts "#{link.text} (#{link['href']})"}
Maps_links.each_with_index{|link, index| puts "#{index+1} #{link.text} (#{link['href']})"}


####MyGoogleSearch2.rb####
require 'rubygems'
require 'mechanize'

suchbegriff= "leihhaus berlin"
agent = WWW::Mechanize.new


puts "\n"+suchbegriff
#puts ".........Mapsergebnisse pfandleihhaus................"
agent.page.forms.first.as_q = suchbegriff
agent.page.forms.first.submit
Maps_links = agent.page.search('h4[@class="r"]/a[@class="l"]')
#links.each{|link| puts "#{link.text} (#{link['href']})"}
Maps_links.each_with_index{|link, index| 
if link.text.index('Exchange') then
puts "Position #{index+1} #{link.text} (#{link['href']})"
      exit
else
#puts "#{index+1} #{link.text} (#{link['href']})"
end
}

#puts ".........Suchergebnisse pfandleihhaus................"
agent.get('http://www.google.de/search?hl=de', {"num"=>"100","start"=>"0", "q"=>suchbegriff})
links = agent.page.search('h3[@class="r"]/a[@class="l"]')
links.each_with_index{|link, index| 
if link.text.index('Exchange') then
puts "Position #{index+1+Maps_links.length} #{link.text} (#{link['href']})"
      exit
else
#puts "Position #{index+1}: #{link.text} (#{link['href']})"
end
}


#puts ".........Suchergebnisse pfandleihhaus................"
agent.get('http://www.google.de/search?hl=de', {"num"=>"100","start"=>"100", "q"=>suchbegriff})
links = agent.page.search('h3[@class="r"]/a[@class="l"]')
links.each_with_index{|link, index| 
if link.text.index('Exchange') then
puts "Position #{index+1+Maps_links.length+100} #{link.text} (#{link['href']})"
exit      
#break
else
#puts "#{index+1} #{link.text} (#{link['href']})"
end
}

###MyGoogleSearch1.rb####
require 'rubygems'
require 'mechanize'

agent = WWW::Mechanize.new

suchbegriffe = [
'pfandleihhaus', 'pfandhaus', 'leihhaus', 'pfandkredit', 
"pfandleihhaus berlin", "pfandhaus berlin", "leihhaus berlin", "pfandkredit berlin", 
'geldwechsel', 'wechselstube', "money gramm",
"geldwechsel berlin", "wechselstube berlin", "money gramm berlin",
'goldverkauf', 'goldankauf', 'goldmuenzen', 'kruegerrand',
"goldverkauf berlin", "goldankauf berlin", "goldmuenzen berlin", 
"usd wechselkurs",  'wechselkurse']


suchbegriffe.each do |suchbegriff|

found=false

puts "\n"+suchbegriff
#puts ".........Mapsergebnisse pfandleihhaus................"
agent.page.forms.first.as_q = suchbegriff
agent.page.forms.first.submit
res = agent.page.search('h4[@class="r"]/a[@class="l"]')
#links.each{|link| puts "#{link.text} (#{link['href']})"}
res.each_with_index{|link, index| 
if link.text.index('Exchange AG') then
puts "Position #{index+1} #{link.text} (#{link['href']})"
found=true
      break
else
#puts "#{index+1} #{link.text} (#{link['href']})"
end
}


if !found then
#puts ".........Suchergebnisse pfandleihhaus................"
agent.get('http://www.google.de/search?hl=de', {"num"=>"100","start"=>"0", "q"=>suchbegriff})
links = agent.page.search('h3[@class="r"]/a[@class="l"]')
links.each_with_index{|link, index| 
if link.text.index('Exchange AG') then
puts "Position #{index+1+res.length} #{link.text} (#{link['href']})"
found=true
      break
else
#puts "Position #{index+1}: #{link.text} (#{link['href']})"
end
}
end

if !found then
#puts ".........Suchergebnisse pfandleihhaus................"
agent.get('http://www.google.de/search?hl=de', {"num"=>"100","start"=>"100", "q"=>suchbegriff})
links = agent.page.search('h3[@class="r"]/a[@class="l"]')
links.each_with_index{|link, index| 
if link.text.index('Exchange AG') then
puts "Position #{index+1+res.length+100} #{link.text} (#{link['href']})"
found=true
break      
#break
else
#puts "#{index+1} #{link.text} (#{link['href']})"
end
}
end

if !found then
#puts ".........Suchergebnisse pfandleihhaus................"
agent.get('http://www.google.de/search?hl=de', {"num"=>"100","start"=>"200", "q"=>suchbegriff})
links = agent.page.search('h3[@class="r"]/a[@class="l"]')
links.each_with_index{|link, index| 
if link.text.index('Exchange AG') then
puts "Position #{index+1+res.length+200} #{link.text} (#{link['href']})"
found=true
break      
#break
else
#puts "#{index+1} #{link.text} (#{link['href']})"
end
}
end

if !found then puts "Nicht unter den ersten 300 Ergebnissen" end

end

SEO - Googlesuche mit Eintrag in Text & Tabellen Formular

require 'rubygems'
require 'mechanize'

agent = WWW::Mechanize.new
time = Time.new
puts time.strftime("%Y-%m-%d %H:%M:%S")

suchbegriffe = [
'pfandhaus', 
'pfandleihe', 
'leihhaus', 
"leihhaus berlin", 
'Pfandkredit',
"Bargeld sofort",
"pfandleihhaus berlin",
'goldankauf', 
'Zahngold',
'Goldmuenzen', 
'schmuckankauf', 
"Ankauf hochwertiger Uhren", 
'Juwelier',
"Juwelier Berlin", 
'geldwechsel', 
'wechselstube', 
"Travelers Cheques"]

ergebnisse = { 
'pfandhaus'=>0, 
'pfandleihe'=>0, 
'leihhaus'=>0, 
"leihhaus berlin"=>0, 
'Pfandkredit'=>0,
"Bargeld sofort"=>0,
"pfandleihhaus berlin"=>0,
'goldankauf'=>0, 
'Zahngold'=>0,
'Goldmuenzen'=>0, 
'schmuckankauf'=>0, 
"Ankauf hochwertiger Uhren"=>0, 
'Juwelier'=>0,
"Juwelier Berlin"=>0, 
'geldwechsel'=>0, 
'wechselstube'=>0, 
"Travelers Cheques"=>0 }


suchbegriffe.each do |suchbegriff|

found=false

puts "\n"+suchbegriff
#puts ".........Mapsergebnisse pfandleihhaus................"
agent.get('http://www.google.de/advanced_search?hl=de&num=100&start=0')
agent.page.forms.first.as_q = suchbegriff
agent.page.forms.first.submit
res = agent.page.search('h4[@class="r"]/a[@class="l"]')
#links.each{|link| puts "#{link.text} (#{link['href']})"}
res.each_with_index{|link, index| 
if link.text.index('Exchange AG') then
puts "Position #{index+1} #{link.text} (#{link['href']})"
found=true
ergebnisse[suchbegriff]=index+1
 break
else
#puts "#{index+1} #{link.text} (#{link['href']})"
end
}


if !found then
#puts ".........Suchergebnisse pfandleihhaus................"
agent.get('http://www.google.de/search?hl=de', {"num"=>"100","start"=>"0", "q"=>suchbegriff})
links = agent.page.search('h3[@class="r"]/a[@class="l"]')
links.each_with_index{|link, index| 
if link.text.index('Exchange AG') then
puts "Position #{index+1+res.length} #{link.text} (#{link['href']})"
found=true
ergebnisse[suchbegriff]=index+1+res.length
 break
else
#puts "Position #{index+1}: #{link.text} (#{link['href']})"
end
}
end

if !found then
#puts ".........Suchergebnisse pfandleihhaus................"
agent.get('http://www.google.de/search?hl=de', {"num"=>"100","start"=>"100", "q"=>suchbegriff})
links = agent.page.search('h3[@class="r"]/a[@class="l"]')
links.each_with_index{|link, index| 
if link.text.index('Exchange AG') then
puts "Position #{index+1+res.length+100} #{link.text} (#{link['href']})"
found=true
ergebnisse[suchbegriff]=index+1+res.length+100
break      
#break
else
#puts "#{index+1} #{link.text} (#{link['href']})"
end
}
end

if !found then
#puts ".........Suchergebnisse pfandleihhaus................"
agent.get('http://www.google.de/search?hl=de', {"num"=>"100","start"=>"200", "q"=>suchbegriff})
links = agent.page.search('h3[@class="r"]/a[@class="l"]')
links.each_with_index{|link, index| 
if link.text.index('Exchange AG') then
puts "Position #{index+1+res.length+200} #{link.text} (#{link['href']})"
found=true
ergebnisse[suchbegriff]=index+1+res.length+200
break      
#break
else
#puts "#{index+1} #{link.text} (#{link['href']})"
end
}
end

if !found then 
puts "Nicht unter den ersten 300 Ergebnissen" 
ergebnisse[suchbegriff]=300
end

end


#...Eintrag im Text & Tabellen Formular, welches einen Klick auf den Submitbutton wegen Javascript benötigt
agent2 = WWW::Mechanize.new
agent2.get('https://spreadsheets.google.com/viewform?formkey=ID')
#e1=agent2.page.forms.first.field_with(:name => 'entry.1.single') 
#e1.value = ergebnisse['pfandhaus']
#pp e1
form = agent2.page.forms[0]

form.fields.find {|f| f.name == 'entry.1.single'}.value = ergebnisse['pfandhaus'] 
form.fields.find {|f| f.name == 'entry.2.single'}.value = ergebnisse['pfandleihe'] 
form.fields.find {|f| f.name == 'entry.3.single'}.value = ergebnisse['leihhaus'] 
form.fields.find {|f| f.name == 'entry.4.single'}.value = ergebnisse["leihhaus berlin"] 
form.fields.find {|f| f.name == 'entry.5.single'}.value = ergebnisse['Pfandkredit'] 
form.fields.find {|f| f.name == 'entry.6.single'}.value = ergebnisse["Bargeld sofort"]
form.fields.find {|f| f.name == 'entry.7.single'}.value = ergebnisse["pfandleihhaus berlin"]
form.fields.find {|f| f.name == 'entry.8.single'}.value = ergebnisse['goldankauf']
form.fields.find {|f| f.name == 'entry.9.single'}.value = ergebnisse['Zahngold']
form.fields.find {|f| f.name == 'entry.10.single'}.value = ergebnisse['Goldmuenzen']
form.fields.find {|f| f.name == 'entry.11.single'}.value = ergebnisse['schmuckankauf']
form.fields.find {|f| f.name == 'entry.12.single'}.value = ergebnisse["Ankauf hochwertiger Uhren"]
form.fields.find {|f| f.name == 'entry.13.single'}.value = ergebnisse['Juwelier']
form.fields.find {|f| f.name == 'entry.14.single'}.value = ergebnisse["Juwelier Berlin"]
form.fields.find {|f| f.name == 'entry.15.single'}.value = ergebnisse['geldwechsel']
form.fields.find {|f| f.name == 'entry.16.single'}.value = ergebnisse['wechselstube']
form.fields.find {|f| f.name == 'entry.17.single'}.value = ergebnisse["Travelers Cheques"]



page = agent2.submit form, form.buttons.first
File.open("res.html","wb+") { |f| f.write(page.body) }

Google Charts

Google Charts

Kurvendiagramm als Polygonzug mit zwei Achsenbeschriftungen, 
y-Achse: Range von 0 bis 120 
x-Achse: einzelne Werte

http://chart.apis.google.com/chart?cht=lc&chd=t:33,31,56,14,44,85,14,12,46&chs=300x200&chxt=x,y&chxr=1,0,120,20&chxl=0:|März|Juni|September|November