Search This Blog

Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Friday, June 29, 2018

Convert From WordPress to Blogger

Try to convert all my post from Wordpress to Blogger site.

Followed the guide:

How to Move Your Blog From WordPress to Blogger
https://www.lifewire.com/move-blog-from-wordpress-to-blogger-1616405

It turns out all 3 sites power by goolge app engine are gone at June 29, 2018.

I went download the latest code:
https://code.google.com/archive/p/google-blog-converters-appengine/downloads
google-blog-converters-r89.tar.gzUpdate for the r89 release. Quick bugfix for the blogger2wordpress conversion.  FeaturedMay 27, 201029.46MB
And hope it works.

1.Export my Wordpress all posts from the Dashboard.
2.On my local python server, created an new Python Virtual Environments:
# virtualenv -p /usr/bin/python2.7 wp2blog
# source wp2blog/bin/activate
3.Download the package and uncompress:
# wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/google-blog-converters-appengine/google-blog-converters-r89.tar.gz
# tar xzvf google-blog-converters-r89.tar.gz

4.Upload my Wordpress export file to the same folder
~/wp_blog/google-blog-converters-r89/milliondollarserver.wordpress.2018-06-29.xml
5.Run the convert and save it to an new .xml file for later import into the Blogger.
# cd ~/wp_blog/google-blog-converters-r89/
# bin/wordpress2blogger.sh milliondollarserver.wordpress.2018-06-29.xml mds_blogger.xml

Download the new mds_blogger.xml file, import it from the Google Blogger.

And I am back online again.

To clean up:
I removed the old nginx configure file and restart the nginx on the server.

Happy Canada Day!

Friday, March 13, 2015

Bath download tumblr.com photos

First install tgrab by pip:


# apt-get update
# apt-get install python-pip
# pip install tgrab


Then create a script to run it in bath:


#!/bin/bash

# Working Folder
WORK_DIR=$PWD

# Array storage the tumblr accounts:
# Example: cars for http://cars.tumblr.com/
array=( cars computerhistorymuseum computer macdesks )

for i in "${array[@]}"
do
echo "*****$i*****"
mkdir -p $WORK_DIR/$i
cd $WORK_DIR/$i
ls|wc -l
tgrab -n $i -p 100 > download.log 2>&1 &
done

cd $WORK_DIR


The script will go through the array then download all photos for the first 100 pages back.
Each tgrab job will running at background, the downloads will be under each folder.

Appreciate the works on tgrab.
And Pythong Rocks!

Monday, August 13, 2012

Installing Python3 on CentOS 6

The latest release of the python scripting language is Python 3.2.3.


But CentOS 6 only comes with 2.6 not event the latest 2.7!


# Install required build dependencies


yum install gcc make openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel



# Download the latest source code package


wget http://python.org/ftp/python/3.2.3/Python-3.2.3.tgz



# Uncompress
tar xzvf Python-3.2.3.tgz cd Python-3.2.3



# Configure with prefix (install dir) to /opt/python3


./configure --prefix=/opt/python3



# Compile, Install and Make link


make sudo make install



# ln -s /opt/python3/bin/python3 /usr/bin/python3



# Verify the installation


/opt/python3/bin/python3