Skip to content

Instantly share code, notes, and snippets.

Avatar

tomasz przechlewski hrpunio

  • Poland
View GitHub Profile
@hrpunio
hrpunio / picasaweb2.pl
Last active Aug 29, 2015
Upload file | Upload file with metadata | Create album | List albums @ picasaweb via API
View picasaweb2.pl
#!/usr/bin/perl
#
# *** Upload file | Upload file with metadata | Create album | List albums @ picasaweb via API ***
#
# Examples of usage
# Note: if option --printonly is present NO real action is performed
# ONLY http message is verbatim printed on STDOUT (useful in case of problems)
# -----------------
# Upload with metadata:
# picasaweb.pl -xload -title Komorowski -descr 'Komorowski w czapce' -keywords 'komorowski,prezydent' -file BK_w_czapce.jpg -album 12345
@hrpunio
hrpunio / picassa_album_create.sh
Created Jul 18, 2015
Create album @ picasaweb
View picassa_album_create.sh
#!/bin/bash
ALBUM_TITLE="$1" # Album title
ALBUM_DESCR="$2" # Album description
Album_Keywords="$3" # Album keywords (comma separated)
ACCESS_TOKEN=$(oauth2picasa.py) ## Acces token is managed with Python's script now
MESSAGE="<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
@hrpunio
hrpunio / picasaweb.pl
Created Jul 12, 2015
Upload file, create album and list albums @ picasaweb via API
View picasaweb.pl
#!/usr/bin/perl
# *** Upload file | Create album | List albums @ picasaweb via API ***
use strict;
use LWP::UserAgent;
use Getopt::Long;
use File::MimeInfo;
use XML::LibXML;
use open ':std', ':encoding(UTF-8)';
my $profileID="default";
@hrpunio
hrpunio / blogger_upload.pl
Created Jul 8, 2015
Upload post to blogger with Perl/Python (OAuth 2.0 authorozation)
View blogger_upload.pl
#!/usr/bin/perl
# *** Wyslanie posta na blogger.com ***
use strict;
use LWP::UserAgent;
use XML::LibXML;
use Getopt::Long;
my $profileID="default";
my $blogID = '1928418645181504144'; # Identyfikator bloga
my $blog_entry ;
View oauth2picasa.py
#!/usr/bin/python
import os
import time
import httplib2
## https://github.com/google/oauth2client
## installed with pip install --upgrade oauth2client (or some other way)
from oauth2client import client
def oauthLogin():
View picasa_upld.sh
#!/bin/bash
MY_PIC="$1" ## filename of the picture to upload ##
ALBUM_ID=6008849823888405298 # ID of picasaweb album
PIC_TITLE=`basename $MY_PIC` # filename w/o extension
PIC_TYPE=`file -b --mime-type "$MY_PIC"`
ACCESS_TOKEN=$(oauth2picasa.py) ## Acces token is managed with Python's script now
## Note that ALBUM_XML URL starts now from https:// now
ALBUM_XML="https://picasaweb.google.com/data/feed/api/user/$USER_ID/albumid/$ALBUM_ID"
View flickr_albums.getPhotos.pl
#!/usr/bin/perl
# Get content of SET or Pool
#
use Flickr::API;
use Compress::Zlib;
use Getopt::Long;
use XML::DOM;
require 'login2flickr.rc';
@hrpunio
hrpunio / gpx2kml.pl
Created Sep 11, 2013
GPX track to KML conversion
View gpx2kml.pl
#!/usr/bin/perl
#
# GPX track to KML conversion
use Getopt::Long;
my $color="ff0000ff";
my $number_w_sign="[\+\-]?[0-9\.]+";
my $quote_sign="[ \t]*[\"'][ \t]*";
my $segment = '';
my $kml_name='??????';
@hrpunio
hrpunio / picasa_upld.sh
Created Sep 11, 2013
Upload pic_file to Google photos/Picasa with curl; returns source image URL
View picasa_upld.sh
#!/bin/bash
# Upload pic_file to Google photos/Picasa with curl; returns source image URL
#
# Usage: picasa.sh -s SCALE -a ALBUMID -t PIC_NAME -u -r pic_file
# -s SCALE -- scale pic_file to SCALE% (with imagemagic's convert)
# -a ALBUMID -- if not given upload to default album
# -t PIC_NAME -- picture name, if not given the same as pic_file
# -u -- print HTML fragment with URL to pic_file
# -r -- remove scaled pic_file
#
View picassa_upld.sh
#!/bin/bash
#returns source image location and thumbnail location
#Usage: picasa.sh /path/to/pic [Pic Name Shown In Album]
# One have to declare ALBUM_ID USER_ID username and password
ALBUM_ID=????????????????????
USER_ID=116390720146821374745
my_pic="$1"
[ -z "$2" ] &&
You can’t perform that action at this time.