Thursday, March 8, 2012

How to Import Blog Content to Blogger via XML

Have you ever used the Blogger import functionality? It is designed to only import XML that you have exported from Blogger, like if you wanted to move a blog from one domain to another. But, what if you want to just import a blog post to your Blogger blog? It would be nice to have the capability to create blog articles using XML and just import. Unfortunately, its not that simple and you will probably get a lot of errors on import. So, I did some research, and I have figured out a way to do it, you just need to have specially formated xml.

If you want to just import a simple blog post to Blogger via xml you can use the following xml code, just replace "test" with whatever you want:

<?xml version='1.0' encoding='UTF-8'?>
<ns0:feed xmlns:ns0="http://www.w3.org/2005/Atom"><ns0:generator>Blogger</ns0:generator><ns0:entry><ns0:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post" /><ns0:id>test</ns0:id><ns0:content type="html">test</ns0:content><ns0:title type="html">test</ns0:title></ns0:entry></ns0:feed>

If you want to import an article and give it a particular category, then you can use this code:

<?xml version='1.0' encoding='UTF-8'?>
<ns0:feed xmlns:ns0="http://www.w3.org/2005/Atom"><ns0:generator>Blogger</ns0:generator><ns0:entry><ns0:category scheme="http://www.blogger.com/atom/ns#" term="test" /><ns0:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post" /><ns0:id>test</ns0:id><ns0:content type="html">test</ns0:content><ns0:title type="html">test</ns0:title></ns0:entry></ns0:feed>

Finally, if you want to import a blog article via XML with time and category you can use this code:

<?xml version='1.0' encoding='UTF-8'?>
<ns0:feed xmlns:ns0="http://www.w3.org/2005/Atom"><ns0:generator>Blogger</ns0:generator><ns0:entry><ns0:category scheme="http://www.blogger.com/atom/ns#" term="test" /><ns0:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post" /><ns0:id>test</ns0:id><ns0:content type="html">test</ns0:content><ns0:published>2011-09-26T20:16:54Z</ns0:published><ns0:title type="html">test</ns0:title></ns0:entry></ns0:feed>

It might be also useful to check out the Blogger API information from Google. Finally, if you are looking for a way to post XML code in Blogger as I have done in this post, just use this Encode / Decode HTML Entities Tool.

Wednesday, March 7, 2012

Get Travelzoo Top 20 Before it's Published

I love to travel and I travel often. I really like Travelzoo Top 20 to get some ideas on cheap destinations or travel deals and today I have realized that you can get Travelzoo Top 20 before it is available to the public. It isn't all too useful as it's usually incomplete before Wednesday, when Travelzoo publishes the Top 20, but you can get to it before it's published through the Newsletter Archive url:

http://www.travelzoo.com/top20/?w=10-2012

That link will take you to the Top 20 Newsletter Archive from March 7, 2012, which is today, but if you go to:

http://www.travelzoo.com/top20/?w=11-2012

you can see the Top 20 Newsletter Archive from March 14, 2012 and today is still March 7, 2012. You can't actually click on the deals, obviously, but you can see a bit into the future which might help you out. I thought this is worthy of sharing. Some other tips that are might be useful to others:

1. While sites like Orbitz or Travelocity are great for research, you will generally always get the same price on airfare or better by buying directly from the Airline.

2. Tuesday and Wednesday is the best time to buy airfare, it could be good on other days but it is generally worse on the weekends.

3. If you are traveling from US, the fall is pretty much the best time to buy flights and summer is the most expensive.

4. If you are using miles to redeem a flight, like let's say on AA, and you don't care about connections, research outside of your city as the connection flight will usually be free.

5. When you are researching flight prices, make sure to look at Airlines (like SouthWest, for example) that do not work with travel websites like Orbitz.

6. If you are booking a ticket on a foreign Airline, make sure you pay in local currency because the prices will be drastically different.

7. Kayak Explore is a great place to start your research for where to fly on your next travel trip.

I rarely book vacations, I just want some cheap airfare and then I will figure it out, that is the adventure, the fun part of travel in my opinion. If you just want to go to Caribbean and chill at a nice resort, then there are many great tools to find good deals. But, if you don't really care about destination (there are so many places in the world I want to see) and you don't care about connections, then how do you figure out how to get the cheapest airfare to your dream destination?

It's actually not that easy and there is definitely an opportunity here for a better travel website or application, in terms of international flights (Google Flight is doing some great things for domestic flights). Here is the issue:

Let's say I live in NJ and I want to travel to Brazil, and I don't really care about connections and where I land in Brazil (I plan on going to a couple places in that huge country). So, what do I search for on Orbitz (or Kayak, Expedia, or Travelocity)? First of all, do I say I am departing from New Jersey or Philadelphia or New York? That part is sort of taken care of by the "search 80 miles around" button, but maybe I don't care about driving down to Baltimore if it will save me a couple hundred dollars too.

In reality, the departure city just does not matter. Also, the destination city does not really matter. What I really want is to select a couple cities from my destination country and see where (and how much) are the direct connections going to my country. This will tell me exactly from what city in my country is the best deal to a city in my destination country. This is generally the most expensive part of the flight and often when you actually book the flight, the connection fare is waived (depending if its treated as same flight). Maybe you buy the connection with another airline, whatever comes out to be least expensive.

No one does this, and it would save me countless hours of researching to get a great deal for my trip. What do you think?

Thursday, March 1, 2012

Fast YouTube Video Downloader Chrome Extension

It has been a while since I have written anything here but I have been super busy working on a bunch of projects. I have been messing around with a lot of HTML5 and canvas and YouTube. I never understood why these "YouTube video download websites" use back-end code to download videos when everything is available on the front-end. Same thing applies to the actual YouTube website. For example, if you are watching a YouTube video (it has to be queued up or playing) you can run this in your console and get the url paths to all the different video files available: yt.player.playerReferences_.player1.api.getVideoData().url_encoded_fmt_stream_map

But, you don't even have to do that because the embed tag that has the video, its flashvar attribute, also has the url_encoded_fmt_stream_map data. It needs to be decoded, a couple of times, but after that you have all the urls to the video files that you need. So, I decided to write a chrome extension that is really fast, simple and user friendly: Fast YouTube Downloader Chrome Extension

Here is how it works: you go to any YouTube video, and you click on the YouTube Downloader Extension in Chrome which will put a link on the page that takes you to the best quality version of the video file. I only show a link to the highest quality format because who cares about low quality if you are downloading the YouTube video to your computer? If you do care, let me know, and I can provide all the links. Here is the extension, just a couple of lines in JavaScript:


YouTube DL

UPDATE: New version of YouTube Video Downloader below does not require a double-click and it will right away open a new tab with the HQ youtube video for download.

YouTube DL