Search This Blog

Sunday, July 21, 2013

Post on Blogspot using cURL with bash

The following bash-script posts an article in the blogspot.

#!/bin/sh

# Authenticate
# Requires $GDATA_PASSWORD to be set as an environment variable.
G_AUTH_TOKEN=`curl 2>/dev/null https://www.google.com/accounts/ClientLogin \
    -d Email=YOUR_EMAIL_ADDRESS@example.com \
    -d Passwd=$GDATA_PASSWORD  \
    -d accountType=GOOGLE \
    -d source=curlExample \
    -d service=blogger \
  | grep '^Auth=' | cut -c 6-`

# Post on my blog.
curl -v --request POST -H "Content-Type: application/atom+xml" \
    -H "Authorization: GoogleLogin auth=$G_AUTH_TOKEN" \
    "http://www.blogger.com/feeds/YOUR_BLOGS_ID/posts/default" --data "@blog_post.xml"

The followings are the field specific for a user account and a blog.

YOUR_EMAIL_ADDRESS@example.com: user account for a blog
$GDATA_PASSWORD: user password
YOUR_BLOGS_ID: blog id
blog_post.xml: data for upload

The following is an xml example to upload.

<entry xmlns="http://www.w3.org/2005/Atom">  
  <title type="text">Knock knock</title>  
  <content type="xhtml">  
    <div xmlns="http://www.w3.org/1999/xhtml">  
      <p>Who's there?</p>  
      <p>Orange.</p>  
      <p>Orange who?</p>  
      <p>Orange you glad you know how to post using curl?!? (lol!)</p>  
    </div>  
  </content>  
  <category scheme="http://www.blogger.com/atom/ns#" term="joke"/>  
  <category scheme="http://www.blogger.com/atom/ns#" term="curl"/>  
</entry>  

In this xml, category scheme defines labels.

http://gdatatips.blogspot.com/2008/08/post-on-blogger-using-curl.html

Code formatter: http://formatmysourcecode.blogspot.com/2006/02/paste-your-text-here.html

Friday, July 19, 2013

How to use 'wget' for 'xunlei.com'

1. Export cookie for 'vip.xunlei.com'. Let's name it 'cookie.txt'.
2. Run the following code

wget -c --load-cookies cookie.txt "address to download" -O savefilename

Wednesday, July 17, 2013

Yamaha Zuma 2t oil

- Yamalube

http://www.yamaha-motor.com/yamalube
http://www.yamaha-motor.com/yamalube/categories/engine-oils/1/2-stroke/1#productscroll

2R - High performance 2-stroke blend
2W - Semi-synthetic formula for sport boats & waverunner, not recommended for 2-stroke land-use vehicles or outboard motors
2S - Semi-synhtetic base and additive 2-stroke engine oil
2M - Outboard semi-synthetic engine oil

2R is known for premix, while 2S for injection.

- AMSOil

Dominator Synthetic 2-Cycle Racing Oil

- Summary of 2-stroke oil

http://www.mopedarmy.com/wiki/Specifications_for_two_stroke_oil

TC-W3 is an outboard specific oil, so not recommended for mopeds.
API-TC, based in the USA, is using metal-based, ash-producing additives.
JASO-FD and ISO-L-EGD would be best for mopeds.

Some JASO-FD and ISO-L-EGD injection type oils
Ipone Scoot City
Ipone Scoot Run

Blog Archive