1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Monday, October 26, 2009

在JavaScript文件中使用Google Analytics谷歌分析的统计代码

在JS文件使用Google Analytics谷歌分析的统计代码-月光博客

  Google Analytics(谷歌分析)是一个企业级的网络分析解决方案,可以让网站主了解详细的网站流量,不过在使用过程中,很多人碰到这样一个问题,就是不想批量修改原来的静态HTML页面,而是使用外部Javascript文件的方式进行修改,而Google Analytics的代码是无法直接加到JS文件中的。

  这里介绍一个方法,使用这个方法,就可以直接将Google Analytics(谷歌分析)的代码放到外部JS文件中了。

  具体方法是,将下面的代码修改为你的ID,然后加入外部JS文件,即可实现在JavaScript文件中使用Google Analytics(谷歌分析)。

document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>');
function analytics()
{
_uacct = "UA-*******-*";//你的ID
urchinTracker();
}
if (document.all){
window.attachEvent('onload',analytics);
}
else{
window.addEventListener('load',analytics,false);
}

Sunday, October 25, 2009

Batch Convert FLV to MP3

Four Loves Four: Batch Convert FLV to MP3

Many times on youtube I find concert videos or acoustic shows that I want to keep for later. Using the Firefox plugin VideoDownloader, I can download these videos as flv files but these flv's are not as portable as mp3. So I searched for a way to convert flv to mp3 and found help on the Ubuntu forums.

After looking at the script and looking at my flv files, I noticed that it would be very inefficient to do each file individually. Therefore, I modified the script to convert a whole folder of flv's. I will show the whole script itself and how to run it, but first lets install some programs that we need in order to convert the flv's.
sudo apt-get install ecasound mpg123 lame ffmpeg
The script itself is the following:
#!/bin/bash
# FLV to MP3
#flv2mp3.sh

FLV_FILE=/home/ditto/Videos/
cd $FLV_FILE

for vid in *.flv
do
ffmpeg -i $vid -f mp3 -vn -acodec copy /tmp/temp.mp3
ecasound -i /tmp/temp.mp3 -etf:8 -o ${vid/.flv}.mp3
rm -f /tmp/temp.mp3
done

exit 0
I save my scripts in a ~/scripts and don't forget to make the script executable.
chmod u+x flv2mp3.sh
Run as follows:
user@home:/scripts~$ ./flv2mp3
Let's take a closer look at the code.
FLV_FILE=/home/ditto/Videos/
cd $FLV_FILE
FLV_FILE is the location of the flv video files that we want to be converted. In the next line, the directory is changed to the location of the videos.

Next, we will look through the files in that directory, only using the .flv files. Notice:
for vid in *.flv
Next we will convert the video to mono audio and create a temporary mp3 called temp.mp3
ffmpeg -i $vid -f mp3 -vn -acodec copy /tmp/temp.mp3
Since the audio by default is mono, we will then convert it to stereo, output it into the current directory, and save it as an mp3, while keeping the basename. The file is renamed by ${vid/.flv}.mp3
ecasound -i /tmp/temp.mp3 -etf:8 -o ${vid/.flv}.mp3
rm -f /tmp/temp.mp3
That is pretty much it. Any comments or ways to make it better, please let me know.

Download YouTube Videos on Linux and Convert FLV to MPG Movies and rip MP3 Audio

Download YouTube Videos on Linux and Convert FLV to MPG Movies and rip MP3 Audio | Webmaster Tips

This tutorial shows how to bulk download YouTube videos on Linux and then convert the FLV files to MPG video and MP3 audio files.

Required Software

I am using Ubuntu Linux, but the concept should be the same for other distros. Make sure you already have all of the multimedia codecs including ffmpeg and mplayer. You will also need to install youtube-dl:

sudo apt-get install youtube-dl

Downloading YouTube Videos on Linux

To download YouTube videos on Linux, use youtube-dl in the terminal like this:

youtube-dl [options] video_url

To see available options type man youtube-dl in a terminal.

Converting YouTube Videos to MPG on Linux

To convert YouTube movies from FLV to MPG on Linux use ffmpeg like this in the terminal:

ffmpeg -i old-file.flv new-file.mpg

Ripping MP3s from YouTube Videos on Linux

It is easy to extract MP3 audio from a YouTube movie on Linux with mplayer.

The method to rip MP3 audio from FLV files with ffmpeg from this site doesn't work on my computer so I use mplayer to do it:

mplayer -dumpaudio old-file.flv -dumpfile new-file.mp3

Automating the Process with a Shell Script

If you want to download a set of YouTube movies and convert them to MP3 audio, or save them as MPG movies on your hard drive, you can automate the process with a shell script.

This is just a quick script showing how it might be done. Use the following code at your own risk, and make sure you understand what it does before doing it. It will delete all the FLV files in the current directory after it processes them.

#!/bin/sh  # This script downloads YouTube videos and converts them # You will end up with an MPG video and MP3 audio of each YouTube movie # You need to install the following three programs: # youtube_dl, ffmpeg, and mplayer  # Use this script at your own risk! # Make sure that you understand how it works before you use it!  # USAGE: # Make a file called videos.txt with the URL of 1 YouTube video on each line. # Don't leave any blank lines in the file # Put the videos.txt file in an empty folder along with this script # run this script with the following commands: # $ ./youtube_downloader.sh # It will take a long time to run, depending on # how many videos you have in your videos.txt file.  while read inputline do   youtube_url="$(echo $inputline)"   youtube-dl $youtube_url done < videos.txt  # Convert the flv files to mpg and mp3 files for i in *.flv do   ffmpeg -i $i $i.mpg   # comment out the next line if you don't want MP3's extracted   mplayer -dumpaudio $i -dumpfile $i.mp3   # The next line deletes all FLV files in the current directory to cleanup   rm $i done 

See also pytube...

Attachment
youtube_downloader.sh.txt

Convert .flv (Google Videos) to .mpg using ffmpeg on Ubuntu

Convert .flv (Google Videos) to .mpg using ffmpeg | Ubuntu Geek

Install ffmpeg Ubuntu

sudo apt-get install ffmpeg

convert .flv to .mpg using ffmpeg

First you need to download your .flv file to a folder and you need to Open a terminal window and go in to the .flv file folder and type the following command

ffmpeg -i jokes.flv jokes.mpg

or:

ffmpeg -i jokes.flv -ab 56 -ar 22050 -b 500 -s 320×240 jokes.mpg

jokes.flv is the file you want to convert, so the name must be the same as the source file.You can name jokes.mpg whatever you want as long as it has the .mpg extension.

-b bitrate: set the video bitrate in kbit/s (default = 200 kb/s)

-ab bitrate: set the audio bitrate in kbit/s (default = 64)

-ar sample rate: set the audio samplerate in Hz (default = 44100 Hz)

-s size: set frame size. The format is WxH (default 160×128 )

支持UCenter的PHP建站程序一览

支持UCenter的PHP建站程序一览-月光博客

  建站程序是站长运营网站的根本,如何结合整合各个不同系统的程序、数据表、架构,提供统一的网站会员系统,一直是困扰很多站长的问题,而使用UCenter可以较为简单的实现不同系统之间的整合问题。

  UCenter是康盛创想推出的免费开源的建站工具,是各个建站产品之间信息直接传递的一个工具,康盛的Team在其Discuz论坛上收集了一批官方支持UCenter的建站产品,以对其进行双向推广,这里我对这个列表进行一些补充,添加一些最新的官方和非官方的支持UCenter的产品。

  支持 UCenter 建站程序一览表

  一、Discuz!

  http://www.comsenz.com/products/discuz
  论坛(BBS)程序站长应用率第一,php,开源,70万以上用户
  康盛创想官方支持UCenter产品,官方Discuz!论坛基础之上推出的UCenter产品
  历史版本 Discuz! 6.1.0
  当前版本 Discuz! 7.0.0

  二、UCenter Home

  http://www.comsenz.com/products/uchome
  国内SNS(社交网络)建站程序站长应用率第一,php,开源,5万以上用户
  康盛创想官方支持UCenter产品
  历史版本 UCenter Home 1.0.0 UCenter Home 1.2.0 UCenter Home 1.5.0
  当前版本 UCenter Home 2.0.0

  三、SupeSite

  http://www.comsenz.com/products/supesite
  网络社区站长常用的CMS产品,php,依托康盛创想社区产品开发
  康盛创想官方支持UCenter产品。
  历史版本 SupeSite 6.0.0_UC
  当前版本 SupeSite 7.0.0

  四、帝国CMS(ecms)

  http://www.phome.net 
  php型CMS程序站长应用目前支持率较高,php,2009年12月8日开源。
  官方支持UCenter
  历史版本 帝国 eCMS 5.1
  当前版本 帝国 eCMS V6.0测试版

  五、PHPcms
  
  http://www.phpcms.cn
  php型CMS程序中小门型应用目前支持率较高,php,开源产品。
  官方支持UCenter
  历史版本 PHPcms 2008 正式版
  当前版本 PHPcms 2008 SP1 正式版

  六、HDwiki 
  
  http://kaiyuan.hudong.com
  国内Wiki程序应用率第一,php,开源
  官方支持UCenter
  历史版本 HDWiki 3.0.0 HDWiki 4.0.0 HDWiki 4.0.2
  当前版本 HDWiki 4.0.5 正式版

  七、PBdigg
  
  http://www.pbdigg.com
  Digg类CMS,php
  官方支持UCenter
  当前版本 PBdigg 2.0

  八、爱聚合
  
  http://www.aijuhe.net
  国内独创的聚合型CMS,php,根据关键词自动聚合资讯、话题、图片和视频4大类内容
  官方支持UCenter
  历史版本 爱聚合 AiJuhe 4.0.0 AiJuhe V5.0
  当前版本 爱聚合 中文版 AiJuhe V6.0

  九、Modoer
  
  http://www.modoer.com
  点评功能CMS,php
  官方支持UCenter
  历史版本 Modoer 1.1
  当前版本 Modoer v1.2 正式版

  十、Feedig
  
  http://www.feedig.com
  feed类博客聚合CMS,php,主要针对UCenter home开发版本
  官方支持 UCenter
  当前版本 Feedig for Ucenter Home

  十一、ECShop
  
  http://www.ecshop.com
  商城类(B2C)建站程序,php
  官方支持 UCenter
  当前版本 ECShop 2.6.1

  十二、ECMall
  
  http://ecmall.shopex.cn
  商城类(C2C)建站程序,php
  官方支持UCenter
  当前版本 ECMall 1.1 final

  十三、SupeV
  
  http://union.ku6.com
  影视CMS,php
  官方支持UCenter
  当前版本 SupeV 1.01

  十四、落伍分类信息(ebcms)
  
  http://www.php.com.cn
  分类信息CMS,php
  官方支持UCenter
  历史版本 ebcms 1.0
  当前版本 落伍php分类v2.0 beta版本

  十五、 织梦CMS(DedeCms)
  
  http://www.dedecms.com
  php型CMS程序中小门型应用目前支持率较高,php,开源。
  官方支持UCenter
  历史版本 DedeCms 5.3
  当前版本 DedeCms 5.5

  十六、赛问(cyask)
  
  http://www.cyask.com
  php的问答类应用,类似百度知道,开源。
  官方支持UCenter
  当前版本 Cyask3.2
  
  十七、PHPsay

  http://www.phpsay.com
  基于PHP+MYSQL架构的WEB2.0开源家族贴吧系统,类似百度贴吧。
  支持UCenter
  当前版本 PhpSay 2.0.6

  十八、Mediawiki 1.13.2
  
  http://www.mediawiki.org
  Mediawiki 1.13.2+UCenter GBK整合精简版
  整合方案:http://www.discuz.net/thread-1077748-1-2.html

Thursday, October 22, 2009

Want To Impress Your Friends? Run Chrome OS

Want To Impress Your Friends? Run Chrome OS

We have all read the news that Google is planning to enter the operating system market with their soon to be released Google Chrome OS which is initially targeting the netbook market. Google Chrome OS is based on Google's web browser Google Chrome and a Linux kernel. Little information are know as of yet. The ones that are available state that Google Chrome OS will be released as Open Source, that it will use a minimalistic design and that it will likely be released in the second half of 2010.

Fake videos showcasing the new Google Chrome OS have been making their rounds on the Internet in the last months. There have not been on the other hand lots of attempts to turn an existing Linux distribution into something that resembles the Google Chrome OS.

Chrome OS is one of the first attempts. It is offered as a Live CD and virtual image currently. Chrome OS uses a GNOME 2.24 desktop environment with the Google Chrome 4.0.207 web browser integrated. Several other programs like Open Office or Flash Player have also been integrated into the distribution.

chrome os

To be 100% clear here. This is a custom Linux distribution and not the official Google Chrome OS. It still resembles the operating system and can be used as a Live CD to run the Google Chrome web browser on Linux. Interested users can download the Live CD or the virtual image from the Chrome OS Linux website.

Download Youtube Videos

Download Youtube Videos

Many Internet users want to download Youtube videos. Downloading the videos can be beneficial in several ways including the option to play the video at any time without having to access the Youtube website on the Internet. It can also save bandwidth and be used to transfer the Youtube videos to devices like cell phones, media players or gaming systems that are usually not connected to the Internet or that do not offer the speed needed to enjoy the videos.

There are basically three ways of downloading Youtube videos: Using a web service, a web browser add-on or a standalone software program. All methods have their distinct advantages and disadvantages. Web services for example are usually independent of operating systems and can be used instantly without having to install software.They do usually lack the ability to download multiple Youtube videos at once.

Web browser plugins require installation. They have the advantage that they work directly on the site which is very comfortable for the user. They also usually do not provide the means to add multiple videos at once to a download queue.

Software programs to download Youtube videos usually come with the option to add multiple video links to the queue before starting the download. They do need to be installed on the other hand and lack a solid Youtube browser sometimes.

Online services to download Youtube videos:

Web services are websites that provide the means to download Youtube videos to a local computer system. Some offer advanced features like converting the video to another format. The list has been limited to ten free services that provide options to download Youtube videos.

1. Keepvid: A straightforward service. The user needs to paste the url of the Youtube video in the form provided on the website. Keepvid will then offer low quality and high quality downloads of the video. Works with other video portals like MySpace video or Dailymotion as well. Offers a bookmarklet which works more comfortably than copying pasting Youtube urls.

keepvid

2. Zamzar: A file conversion service that can not only download Youtube videos but also convert the videos into different formats. Great for users who need the video in a different format and do not want to convert them on their computer system.

Zamzar

3. KCoolOnline: Currently supports 231 video portals including Youtube. It has a basic interface. All that needs to be done is to paste a video url in the form to download the Youtube video. Users who like to download videos from many different video portals might like this as it supports a lot of them.

KCoolOnline

4. Video Downloader: Another basic web interface that allows users to download and convert videos from sites like Youtube, Dailymotion or MySpace. Nothing much to say about this service except that it offers downloads in the original flv format but also in mp4 out of the box.

Video Downloader

5. SaveVid: Offers Youtube videos in original flv or mp4 format. Displays a live list of videos that get downloaded by users on the website which can be a great source of videos as download links are displayed directly. Offers top 10 lists, archives and categories as well.

SaveVid

download youtube videos

6. Vidgrab: Vidgrab offers a web form that can be used to paste Youtube videos into it. These videos can then be downloaded in their original format. One interesting aspect of Vidgrab is the list of popular videos that are displayed on the website. These can also be downloaded directly to the computer system.

Vidgrab

7. Vixy: Vixy is a video converter that supports Youtube videos. It does not offer the means to download Youtube videos in their original format. Videos can be converted into various formats including avi, 3gp, mov or mp4.

Vixy

8. KeepTube: Online service to download Youtube videos with preview and options to download the video in various formats including normal and high quality flv, 3gp and mp4. Offers additional ways of downloading the videos including a bookmarklet and a very ingenious way by adding keep- after the www. of the youtube url.

KeepTube

9. KissYoutube: Offers a similar service as Keeptube by allowing users to add the word kiss after the www. of the youtube url to download videos directly without having to visit the KissYoutube website manually. Comes with the usual form to download videos from Youtube as well.

KissYoutube

10. Video Getting: Another service that combines video downloading and conversion in one interface. Users can paste Youtube videos in the form and download them in eight different formats.

Video Getting

download youtube video

Web Browser Add-ons to download Youtube videos

The following list contains ten web browser add-ons and plugins for popular web browsers such as Mozilla Firefox or Internet Explorer that allow users to directly download videos from video portals like Youtube. These add-ons have the advantage that the videos can be downloaded directly without having to visit another website to do so.

1. Video Download Helper (Firefox): One of the most popular Firefox add-ons. It supports many different video portals including Youtube. The add-on will change its icon in the status bar whenever a website with media links is visited.

Video Download Helper

2. NetVideoHunter (Firefox):

NetVideoHunter: Will recognize Youtube videos and add them to its queue with the possibility to download the videos immediately or at a later time. Videos can also be played in the interface as well.

netvideohunter

3. Viloader (Firefox, Internet Explorer, Opera): A plugin that installs itself in three different web browsers. It offers a download video right-click context menu option that can be used to download the videos from Youtube and other video portals.

Viloader

4. IE7Pro: IE7Pro supports Internet Explorer 8 as well despite its name. It comes with a userscript engine and a script pre-installed that can download Youtube videos. The browser plugin will display a download video link in the video description on Youtube.

IE7Pro

internet explorer youtube video downloads

5. Flash Video Downloader (Firefox, Internet Explorer, Opera): Flash Video Downloader operates a web service to download videos and an add-on that can be installed in Firefox, Internet Explorer and Opera. The Opera is one of the few Youtube video download widgets that currently work with Opera 10.

6. Google Chrome Bookmarklet: Users can use a bookmarklet to download videos in the Google browser. All they need to do is to create a new bookmark in the web browser and add the following JavaScript code as the url:

javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + swfArgs['video_id']+ "&fmt=18" + "&l=" + swfArgs['l'] + "&sk=" + swfArgs['sk'] + '&fmt_map' + swfArgs['fmt_map'] + '&t=' + swfArgs['t'];

A click on the bookmark on any Youtube video page will download that video in the Google Chrome web browser.

Software Programs to download Youtube videos

The following list contains software programs for all popular operating systems that allow a user to download videos from Youtube.

1. TubeQueue (Windows):

TubeQueue: A program for the Windows operating system that can queue, convert and download multiple Youtube videos. The program comes with its own search interface making it completely independent from the Youtube website.

youtube videos download

2. Free FLV Converter (Windows):

Free FLV Converter: A software program that can search for, download and convert Youtube videos and videos from other web services. It's biggest strength is the search that can easily handle thousands of results providing comfortable options to download multiple videos at once from Youtube.

youtube mass downloader

3. Orbit Downloader (Windows) : Orbit is a very popular download manager that supports a variety of popular media sites out of the box including Youtube, MySpace or Pandora. It integrates with web browsers and comes with the Grab++ module that can be used to catch and download media files.

Orbit Downloader

4. Youtube-DL (Linux, Windows): A command line program to download videos from Youtube

Youtube-DL

5. Abby and CCLive (Linux): Abby is a frontend for CCLive that can be used to download videos from various popular video hosting websites including Youtube.

Abby and CClive

6. GetTube (Mac): An application for Apple Mac computers that can be used to download Youtube videos.

GetTube

There are literally dozens of other applications, web services and browser plugins that can be used to download videos from Youtube. Please leave a comment if you think we should add another free services, plugin or software to the list.

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...