Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

5/30/13

Getting started with the Mind Body Online (MBO) SOAP API - classic .ASP VBSCRIPT

I've been working on the Mind Body Online API for a few weeks now and finally got things to come together. My challenge was that I'm still coding in classic ASP and all the sample code is PHP - so I had to start from scratch to get things up and running.
The final collection of code is too extensive to post - but as a starter here is the .ASP code that retrieves the test class collection from the -99 test MBO account.

9/28/11

JS compressor and optimizer

yet another great resource from Google that i've overlooked until now. Take any js file - and optimize it simply by pointing this tool to the URL for your js file. http://closure-compiler.appspot.com/home happy coding. bp

9/27/11

Using Google Webfonts

Not sure how i missed this one - but google has a great way to move beyond traditional 'web safe fonts'. Point your browser to: http://www.google.com/webfonts fast, very easy to deploy and free. Between this and HTML5 we'll never have to use graphic designers again for headings :-) -bp

11/15/10

7 essential geek skills for the modern marketing master

In today's business climate it should go without saying that any business that ignores the internet and associated technologies will be crushed and dismembered by competition that doesn't. In spite of the almost universal acceptance of this fact I consistently run into men and women in senior marketing positions within respected companies that have adopted a "that's not my job" attitude towards learning, adopting and understanding modern internet enabled marketing. If you are one of them (and you know it if you are...) then these 7 skills are written with you in mind.

1. Facebook
I'm simply boggled when I run into marketing directors who fear Facebook. Be you a VP, Director or Manager of marketing, if you don't embrace Facebook, learn it, use it, integrate into your personal life and then look at your competition through Facebook eyes you are, quite frankly, a dinosaur. Like those ancient reptiles, you and your career are rapidly approaching extinction and the slow fade into irrelevance. Simply delegating responsibility for Facebook use to subordinates or an agency is a cheap and ineffectual cop out. Until you "get it" at a personal level, throwing money at consultants is a waste of your marketing budget dollars, since you won't understand the efforts, results or potential.

2. Web analytics
Every website on the planet needs to have an analytic package (like Google analytics) installed. Most do. Unfortunately, what needs to be connected to the analytic package is a human brain. Yours! If your idea of information management is to have someone put a report on your desk once a week, you are destined to always be looking at out of date data. To short circuit this process, learn how to answer basic questions yourself. It isn't hard, and what you will quickly learn is that you and your strategic brain are the best person to pose questions and look for information. Too many marketing people simply dismiss this as "not my job" or think that by delegating it they have solved the problem. Don't be weak minded. Embrace the quant side of your job, learn the basics and you'll be able to get answers to your questions in seconds.

3. HTML
I can already see your eyes rolling. "I don't need to know this". "What a waste of my time". Wrong on both counts. HTML and web construction technology are the underpinnings of the entire world. If you don't have a basic vocabulary and understanding of what web pages consist of, then you are ignorant, vulnerable and out of date. Too many times I've seen smart people unwilling to learn even a little bit of tech, only to be taken advantage of by those who know more about it than they.

4. Email
Seriously. If you don't know how bulk email works, what the can-spam act involves, how to measure email performance, what makes good email design, how to benchmark your email program, how to integrate email into your communication plans, you might as well go home early and enjoy that second martini. In spite of advances in all sorts of groovy new technology, email is here to stay.

5. Mobile devices
If you are a senior marketing manager and are still carrying a dumb cell phone, dial zero and ask for your VCR back. Then take the rest of the day off. We live in a world where many people only have a cell number, email is considered old fashioned and formal and 90% of all non-work activity starts on smart phone. How does your company present itself to a smart phone user? How do you?

6. PPC (Pay-per-click)
Ever notice those annoying little ads that appear when you search for something in google? The ones above and to the right of your search results? You might not ever click on them, but your customers do. Especially if they are relevant to what they are looking for. Especially if the organic search results aren't. If you don't know how a PPC campaign runs, what parameters are available (wouldn't you like to talk to each person who visited your website without buying and offer them something special? Did you know you can? Did you know your competition already is?) and what your PPC strategy is, then you are simply not doing your job. Delegating without understanding isn't delegating. It's called being lazy. Learn about PPC and you'll better be able to make high level decisions about budget and strategy. Plus you'll start clicking on your competitor's ads just to piss them off.

7. Excel
What on earth is this doing here? I'm sure you all are already experts on excel. Just the other day you added a green background to three cells without even using the manual. The most underused application on the planet is excel. Did you know that excel can talk directly to Google analytics AND your internal database? Did you know that this allows your staff to create reports that automatically populate themselves with accurate and current information each time you open the file? Did you know that you can work collaboratively with excel using windows office live? Did you know that pressing control and down arrow at the same time moves to the bottom of a column? Given the amount of time you and your staff spend on excel, getting 5% more efficient can save thousands of hours each year, yet almost no one bothers to learn the more advanced features. Don't be one of the ignorant masses. If you do anything within excel more than 5 times in a row, there is a better way.

9/10/10

Using oAuth Twitter protocol with VBScript Classic ASP

Update: My twitter feed stopped working when the API was modified October 10, 2012. Luckily changing the code was straight forward and required simply updating the destination for the various post/get statements with the new HTTPS urls as so:

'******************************************************************************
' TWITTER CONSTANTS (add to suite)
'******************************************************************************
'' Const TWITTER_OAUTH_URL_ACCESS = "http://twitter.com/oauth/access_token"
 Const TWITTER_OAUTH_URL_ACCESS = "https://api.twitter.com/oauth/access_token"

'' Const TWITTER_OAUTH_URL_AUTHENTICATE = "http://twitter.com/oauth/authenticate"
 Const TWITTER_OAUTH_URL_AUTHENTICATE = "https://api.twitter.com/oauth/authenticate"



'' Const TWITTER_OAUTH_URL_REQUEST_TOKEN = "http://twitter.com/oauth/request_token"
 Const TWITTER_OAUTH_URL_REQUEST_TOKEN = "https://api.twitter.com/oauth/request_token"
 


'' Const TWITTER_OAUTH_URL_UPDATE_STATUS = "http://twitter.com/statuses/update.json"
 Const TWITTER_OAUTH_URL_UPDATE_STATUS = "https://api.twitter.com/1.1/statuses/update.json" '--updated 10/18/2012

The recent move from REST to oAuth protocol for the twitter API left some developers (like me) scratching our heads. Most of the sample code was written either for PHP or .NET folks - leaving those poor bastards who are still writing VBScript out in the cold.


Luckily for us - Scott at http://scottdesapio.com/VBScriptOAuth/ has put together a great resource for migration to the new platform.

Start with the link above then note that you must:
1. update the _config file with vars supplied by twitter dev site AFTER you register your app. Note that at the time of registration you must provide your call back url (which in the example from scott would be something like http://www.logsitall.com/oAuthASPExample/twitter/callback.asp)

2. update line 40 of base.js file

3. update base.js to refer to your domain, not 127.0.0.1

4. comment out the if statement that seeks to assign window focus to 127.0.0.1 at the end of the base.js file

When you are done, you'll have a system that requests the token from twitter and then uses this token in conjunction with the token's associated with your app to make posts to twitter status feeds.
-->
From a dB standpoint - i think you only need to store the user token - then pair this with the app tokens (which are persistent) in order to make twitter updates on behalf of your users.

Good luck and happy coding.

LogsItAll example:

http://www.logsitall.com/oAuthASPExample/

2/22/10

Adding live chat to conversion pages

One of the holy grails of web development is increasing conversion rates on key pages - new user registration, vacation booking, product purchasing, etc. In addition to traditional approaches, why not try adding a live chat client to the page - so that your customer support people can be there "virtually" during important conversion processes?

www.olark.com is one of many providers of this service. For the past couple of weeks i've been testing their web based service with good results. On this post you'll see a 'click here for...' overlay in the lower right hand corner of the page.

The concept is simple - create an account on olark.com - couple this with a chat client (they use jabber) and paste a few lines of javascript just before the close body tag on your key pages and you are ready to roll. Because i find myself having to offer support during off hours it was important for me to be able to offer chat support from my iPhone - this required two additional steps.

1. after configuring the olark account i used Meebo.com on olark's recommendation. Meebo.com is a universal web based chat client.

2. I tested a few iPhone chat apps and finally settled on meebo's own free iphone app - no ads, stable and free. Since the app stays 'online and available' by default - i was essentially able to offer 24/7 live chat support.

The verdict? Although my users don't take advantage of the feature very often - those that do are grateful. It is a bit tricky to remember to log off during my sleep hours or time away from the phone - so i've ammended my chat instructions to read "if you don't get an immediate response, please email..."

Good luck and happy coding.

2/19/10

getting started with google table visualization

google offers a very cool way to display data in a dynamic fashion with little more effort that you'd spend building a standard html table - if you know how to do it...






getting started: visit and book mark these two pages
http://code.google.com/apis/visualization/documentation/gallery/table.html
http://code.google.com/apis/ajax/playground/?type=visualization

They will be your friend for the duration of the exercise. The first rule to remember when working with the tables:
1. Google will not tolerate a single error. period. Miss a comma, formatter, line, etc. and the whole thing simply won't render.

The second rule - don't forget the first...

With this in mind - let's take a quick look at the structure.
add/define the columns: data.addColumn('date', 'Date');
define # rows: data.addRows(6);
add data/cells:
data.setValue(0, 0, new Date(2008, 1 ,1));
data.setValue(0, 1, 30000);

The number one thing that screwed me up was the data type - if you assign the type "number" and accidently put in a non-numeric value - then the table won't render. The second thing - the data format has to be in a google specific format as shown above: new Date(2008, 1 ,1). This date is actually Feb 1, 2008 - since the months start with zero. I had to write a vbscript function to create dates in this format (not knowing any other way to do it). Next tip - string values have to be enclosed in ' marks, numeric values can not be.

Last two problems i found - when rendering data that had been entered via text area - the table wouldn't render. I finally figured out that the text area (due to my wrap settings) was putting in vbLf (line breaks) - this was then rendering a line break in the html code that was trying to generate the table - and blowing up. Doing a Replace(raw-text,vbLf,"") did the trick. The last one was one that any decent javascript programmer would know for sure - i had to escape all ' chars - by rendering then as /' using a similar replace function.

The last problem didn't really have anything to do with the table itself - instead it was a css/style issue - where the background color that was assigned to a div was selectively hiding text within the div ONLY when the google table was present and rendered (and only in IE browsers). If the table javascript code was there, but the table didn't load (due to an error) the div/background color issue wouldn't happen. The text would appear and dissapear when specific mouse over patterns occured over the google table. very odd. on the production site i solved this issue by using an inline style within the div that normally had a background color <-div style="background:'';"-> IE browser had the background color supressed - allowing the text to be seen, firefox and others ignored this command and still showed the background color.

Update: assigning an explicit width to the div that holds the datatable prevented the table from 'spilling over onto' the content in the other column.

The final result?
http://www.logsitall.com/tidy.html