« prev next »

My Blog on My Mobile Via WAP

Related Categories
  Culture
  Government
  Internet
  News
  Olympics 2008
  West Meets East
  New Tech
  WAP

These days, I have setup the WAP site for Wangjianshuo's Blog. I can get the latest comments on my web site and the total hit count from my mobile. I'd like to share the source code and steps with all blog users - especially for MovableType owners since you can convert your web site to WAP site with the code I provide.

How to access the WAP site

If you have a WAP-enabled mobile, please visit the following web site:

http://home.wangjianshuo.com/wap/

Here is the two images (left is the home page displaying all the comments and the right picture shows the hit counter)

picture-ot715.wap-index.PNG picture-ot715.wap-hits.PNG

The above are the simulated OT301 screen using UP.Simulator. I hope I can give you a picture of the page on my Alcatel OT715 one day.

Note: If you click the link above in Internet Explorer, you will not see the page. Instead, you are prompted to download the page, since it returns "text/vnd.wap.wml" as content type which cannot be proccessed by Internet Explorer.

The WAP page - WML file

If you save the page to your local disk and open it in notepad, you will see the following codes:

<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card id="index" title="Wangjianshuo's blog"> <p><a href="index.asp?id=353">Jian Shuo Wang</a></p> <p><a href="index.asp?id=352">p1gs1ck</a></p> <p><a href="index.asp?id=351">KLN</a></p> <p>* <a href="hits.cgi">Hits</a></p> </card> </wml>

After you click the *Hits link, you get the following WML code:

<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <head> <meta forua="true" http-equiv="Cache-Control" content="max-age=0"/> </head> <card id="hit" title="Page Hit"> <p>Page hits: 127502</p> <p>[<a href="index.asp">Back</a>]</p> </card> </wml>

Code behind the sceen

I used an ASP file to do the job. You can easily convert it to Perl or PHP code. If you are using MovableType, follow the steps below to create a WAP index template.

1. Open MovableType console and open the blog you are editing.
2. Click "Templates" on the left navigation bar.
3. Click "Click new index template" in the Index Template section.
4. Enter "WAP Index" in Name field and "WAP/Index.asp" in the Output file field.
5. Use the code below in the Template body field.
6. Save the template and rebuild. You will have the WAP page at WAP/index.asp.

<% ' ' Copyright 2003 Jian Shuo Wang ' URL: http://wangjianshuo.com ' Author: Jian Shuo Wang ' Created: March 18, 2003 ' Description: ' This page displays the latest comments ' on any mobile phone supporting WAP. ' %>

<%
Response.ContentType="text/vnd.wap.wml"
If Request("ID") = "" Then
Response.Expires = -1
End If
%>

<%
'
' The standard header every card need
'
%>

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<%

Select Case Request("ID")

' =================================
' Comment content
' =================================
%>

<MTComments lastn="5">
<%
Case "<$MTCommentID$>":
%>
<card id="index" title="<$MTCommentAuthor$>">
<$MTCommentBody$>
<p>- by <$MTCommentEmail$> at <$MTCommentDate$> from <$MTCommentIP$></p>

<p>[<a href="?">Back</a>]</p>
</card>
</MTComments>

<%
Case "":

' =================================
' Homepage - Comment Index
' =================================
%>

<card id="index" title="<$MTBlogName$>">
<MTComments lastn="10">
<p><a href="index.asp?id=<$MTCommentID$>"><$MTCommentAuthor$></a></p>
</MTComments>
<p>* <a href="hits.cgi">Hits</a></p>
</card>

<%
Case Else:
%>
<card id="index" title="Wangjianshuo">
<p>Something wrong with the page</p>
<p><a href="?">Back</a></p>
</card>
<%
End Select
%>
</wml>

Comments on the code

1. Response.ContentType="text/vnd.wap.wml" must be included since it let the WAP browser understand it is a WML content since it cannot be judged from the .ASP extension.
2. It may need some modification before it can work on your site.

Posted by Jian Shuo Wang at March 20, 2003 11:21 PM
Copyright: You are free to redistribute this work, as long as you keep this disclaimer and this link: http://home.wangjianshuo.com/archives/20030320_my_blog_on_my_mobile_via_wap.htm

Related Entries: WAP
  1. 20 RMB per Month Unlimited WAP December 25, 2005
  2. My Blog on My Mobile Via WAP March 20, 2003
  3. Blog on WAP March 18, 2003
  4. WAP on Wangjianshuo.com March 10, 2003
Comments

Cool! This is quite a neat functionality. I have a WAP phone myself (the Nokia 6310i) -- maybe I should try to get WAP flying on that one (I know it has WAP; I just never used it :-)

Thanks!

Posted by: andersja (external link) on March 21, 2003 1:27 AM

Hi, I have a WML page that i have put on a IIS server. I can access this file via a simulator. But i cannot access this via my mobile phone(Nokia 8310) though theserver is opened to the internet. pls help me and let me know how to configure my server or any thing i shud do to getthis thing working.

thankx.

Posted by: Manora on August 25, 2003 2:12 PM

There is almost nothing need to be done for the server to serve a WAP/WML page if they can serve HTML page. Maybe the ASP page with the following directive may help.

Posted by: Jian Shuo Wang (external link) on August 25, 2003 2:24 PM

Very nice and useful website. Please visit my website!!! :)

Posted by: Webmaestro (external link) on October 17, 2003 3:56 PM

Thank's for the Information,I'll be back soon! Nice Greetings And have a good time
Greetings from me!!

Posted by: ricky (external link) on May 10, 2004 5:49 PM

Yes! Nice blog for all.

Posted by: brickred.com . (external link) on June 24, 2005 3:36 PM

Penis enlargement products at guaranteed cheap price!

penis enlargement pills, penis enlargement patches, penis enlargement devices, penis enlargement exercises, penis enlargement gel, and penis enlargement treatments with FDA approroved guaranteed. www.gordoniihoodia.net

Posted by: penis enlargement (external link) on April 22, 2008 4:37 AM

wap this past, html-mp the future

Posted by: FS (external link) on April 23, 2008 11:44 PM

Free Mobile Adult 3GP Video Downloads, Browse Cumshots, Anal, Blowjobs and more. The Home of Free Mobiel P*rn

Posted by: Free Mobile 3GP Porn Videos (external link) on May 16, 2008 7:49 PM

Acomplia (rimonabant) is an anti-obesity drug. It was approved for marketing in the European Union in June 2006. Rimonabant is not yet approved for use in the United States, where it is known as Zimulti. www.acompliaonline.com

Posted by: Acomplia (external link) on June 25, 2008 10:55 PM
Post a comment
Name:

Email Address: (will not show)

URL: (optional)

Comments:


It may take up to 30 seconds before the server returns a result. IP address recorded.
Remember my information?

<-- Please click POST only once
© 2001 - 2008 Jian Shuo Wang. All right reserved.