Tag: iphone

Jump to:

Photo

We are observing?

Jun 28 09
We are observing?
Tags

Dinosaur globe

Jun 15 09
Dinos - CameraBag Helga
Tags

Let's rest for a spell

Jun 15 09
Maeby - CameraBag 1974
Tags

Article

How to: Linkblog via iPhone on Textpattern

Jun 24 09

With the power of Safari, the iPhone is more than capable of loading just about any administrative blog interface. It is not the optimal solution for banging out long posts. It is, however, more than capable of running a linkblog. While there are dedicated iPhone applications for several popular blog types—including some real bang up Tumblr apps—there is no such app for my platform of choice: Textpattern.

Thing is, if you’re just interested in posting interesting links like right now you hardly need a dedicated app. With a little bit of forethought and a handy bookmarklet you too can share interesting links with the world via your Textpattern site. Let’s go!

Step 1: Lay the foundation

Textpattern ships with a special link function. I don’t ever use it. This is partially because I’ve been running Textpattern since the release candidate days and the feature was poorly explained nor as robust as it is now. I keep my links in Textpattern articles.

When I had decided to add a link section I had several features I wanted from it. When posting a link I wanted the section to:

  1. Allow me to use Textile in the description.
  2. Show up in my feed—both mixed and section specific.
  3. Accommodate extra links should I so choose, which is arguably the same as reason number 1.
  4. Be friendly with Textpattern forms.

The only way I could check off all of these requirements was to post these links as articles. So that’s just how I set up the section. I made a new section named “link” and set it to be on the front page—it will appear on the front page when I call <txp:article/>—and to be included in site search. As I’m not using the default Textpattern feeds I didn’t much care if it’s syndicated. You might want to look into rolling your own feed if you set up a link section in this way. More on that in a bit. If you don’t want to segregate your linked list as a separate section you can easily post everything in the default article section.

Create a new section for your links.

Textpattern uses a cookie store the device with which you last logged into the admin. This can cause a bit of a snag if you’re trying to use the same login credentials on both desktop and iPhone. Instead of posting a link you’ll end up looking at the login screen and that info you were trying to pass on just gets lost in the ether. The solution is simple: make a new author.

Add a new author so you don't have to sign in repeatedly.

I made a new author that I only use on my phone. I set him up with the same name and email address as my primary author because that info is transmitted via meta tags. It’s not terribly important, though you do need to use a real email address because the password is sent that way. I gave my iPhone account the privileges of “Staff Writer” but you can set him up to have any account type as long as it is allowed to create articles.

The final preparatory step is setting up a place to store the link’s URI. Textpattern allows you to assign up to 10 different “Custom Fields” to articles. Pick one of them. It doesn’t really matter which one, but keep track of it. Make sure to give that field a dedicated name under Admin > Preferences > Advanced because only named fields show up in the Write tab. If they’re not already in use, the default “Custom_1” and “Custom_2” will work just fine.

Name a custom field in the Admin section.

Let’s recap. In order to prepare to post links to external sites as articles I:

  • Created a new section. This could have been skipped had I been okay with links appear in the same section as articles. But it wasn’t and I did.
  • Set up a new author so I don’t need to sign in repeatedly.
  • Chose a custom field to store the linked site’s URI.

Got that? The next step is where the real heavy lifting takes place.

Step 2: One word: bookmarklets

Bookmarklets—tiny bits of Javascript launched from a browser’s bookmarks—are the key to sending information from one website to another. When tapped, this bookmarklet will look at the current site in Safari and copy the address and the title1 to Textpatten’s article tab. Sure, now that the iPhone supports cut-copy-paste you could do this manually, but why would you? Installing a bookmarklet turns a mildly fussy procedure with several taps and holds into a two tap operation.

So, you’ve told your iPhone to sync your Safari bookmarks, right? Good. It’s going to be a whole lot easier if you do.

The first thing is to build a bookmarklet for your site. Thankfully, this has all been spelled out on the Textpattern forums. The code is replicated below. Copy this into your text editor of choice.

javascript:
var d=document,
w=window,
e=w.getSelection,
k=d.getSelection,
x=d.selection,
s=(e?e():(k)?k():(x?x.createRange().text:0)),
f='http://PathToYourTXPFolder/index.php',
l=d.location,
e=encodeURIComponent,
p='?bm=1&Section=SectionName&from_view=1&Category1=CategoryName&Title='+e(d.title)+'&Body='+e(s),
u=f+p;
a=function(){
  if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=800,height=800'))
    l.href=u;
  }
  ;
if(/Firefox/.test(navigator.userAgent))
  setTimeout(a,0);
else
  a();
void(0)

In order to work the following lines need to be changed:

  • Change f='http://PathToYourTXPFolder/index.php', to the address of your Textpattern’s administrative page. This is usually http://yoursiteaddress.tld/textpattern/index.php
  • Change Section=SectionName to whatever section these linked sites should be posted under. In my cast that would be Section=link.
  • Change Category1=CategoryName to whatever Textpattern Category the links should have. The second category can be specified by adding Category2=CategoryName but make sure that it is separated by &. I’m not using Categories in this way so I deleted this bit.
  • Add the following to this line: '&custom_1='+e(l.href). This is what copies the site’s address to the custom field selected to hold the link’s URI. In my case that is Custom 1.

This line—the one that stats with p=—is the important one. It controls what gets transferred and where. Here’s what mine ended up looking like:

p='?bm=1&Section=link&from_view=1&Title='+e(d.title)+'&Body='+e(s)+'&custom_1='+e(l.href),

Translated from the original Javascript this line says that I’ll be posting into my link section. The document’s title will be the new article’s title. Whatever text I’ve selected will be passed into the article’s body. The document’s URI will be be passed into custom 12.

So you’ve got your nascent bookmarklet all set up. You’ve told it where your admin page is. You’ve set a Section. You’ve chosen your Categories (or deleted them altogether). You’ve told it to copy the URI to a Custom Field. It’s almost ready.

There’s just one problem: too much white space. You can’t use a bookmarklet with all these lines and spaces. You could strip it out yourself, but it’s a far sight easier to just copy this whole mess and paste it into the Bookmarklet Builder. Just paste the whole mess into the textarea, give it a snappy name, and then click “Format” and “Compress.” Bookmarklet Builder will give you a nice handy link suitable for dragging and dropping into the Safari’s bookmarks. I would recommend that you install a copy in your Bookmarks Bar and in your top-level Bookmarks. The former will be useful in the desktop Safari. The latter will be a bit easier on iPhone. Of course, the bookmarklet works in every browser, but only Safari will sync to iPhone.

Add the bookmarklet to Safari Bookmarks. Plug in iPhone. Sync.

A recap of step 2. In this step I’ve:

  • Configured a bookmarklet to post the desired information to my Textpattern installation.
  • Added said bookmarklet to Safari.
  • Synced it to iPhone.

Now it’s time to put it to use.

Linkblogging on the go

iPhone in hand, visit a site you’d like to share with your lovely, intelligent readers. You’ll need to visit it in Safari, so if you’ve a ken to share a page found via Twitter or feed reader you’ll need to hit the “View in Safari” button.

View a page in Safari.

Provided you’ve upgraded to iPhone OS 3.0 (and I doubt you’d be reading this if you haven’t) you can copy and paste text from linked sites into your own—as a blockquote say. You might want to go ahead and copy that text now unless you really enjoy swapping tabs/windows. Not that there’s anything wrong with that.

Tap your bookmarklet.

Now it’s time to put that bookmarklet to use. With the page loaded in Safari tap the bookmarks icon at the bottom of the screen—you know, the one that looks like a little book. Scroll down to wherever you saved it and tap the bookmarklet. This is why I recommend saving a copy in the top-level of the bookmarks.

The write panel will appear.

The URI will be filled into the custom field, and the page's title attribute appears as the article title.

Safari will open a new window with your Textpattern write tab—provided, of course, that you’ve logged in with the special new phone account. You’ll see the page title from the site you just visited will already be in the article’s title field and the address will be in the custom field chosen to hold the URI. Great!

The link section is automatically selected. I like to turn off comments on these posts.

Scrolling over—the administrative interface isn’t really built for a screen that tops out at 480px—you’ll see that the section for this article has automagically been set to link instead of the default. I also like to turn off comments for my links. I’ve ensured that the comment form doesn’t appear on this section through the presentation, but I still like it off thank you very much. There doesn’t seem to be a way to do this via the bookmarklet.

Type (or paste) the link's description in the article body area.

Type a description for this link in the body. Here’s where you can make use of that fancy new cut-copy-paste you’ve been wanting for so long. Use the excerpt field below too if that’s your thing.

Tap publish and you're done.

Tap submit and…

Your article has been posted!

Your link has been posted. Good for you!

Oh balls! I very nearly forgot!

I’d be remiss if I didn’t mention just how the hell you’re going to display all of this. Those of you with even a passing familiarity with Textpattern have probably figured out that our little article is going to be of little use if the link doesn’t go anywhere offsite.

With my links I like to have the title of the link go to the page and not to the permanent link on my site3. That’s how Gruber does it and it’s just flat out the right way to do it. You don’t have to do it that way, but you’d be wrong.

No matter where you choose to put the link’s URI, call it up in your forms using the <txp:custom_field/> tag. Here’s how I set mine up:

<a href="<txp:custom_field name="linkURI" />" title="<txp:title />">
  <txp:title/>
</a>

Set the custom field name to whatever you set it to earlier. You could wrap this link around whatever you want, such as a spot of text that says “go away!” or some such thing. That’s not very helpful link text, but nobody is stopping you from doing it.

And finally…

To sum up a rather overlong, excessively wordy, and painstakingly specific tutorial, here’s what just happened. In order to post links via iPhone to my Textpattern based site I:

  • Added a section in which to store these articles.
  • Created a new author to circumvent Textpattern’s security cookie
  • Named a custom field to store the linked site’s URI.
  • Configured a bookmarklet, compressed it, and synced it to my iPhone.
  • Posted a link to my site on the train home from work.
  • Oh, and I also made sure my Textpattern forms were in order.

It occurs to me that this entire tutorial could be boiled down to a few succinct sentences. It also occurs to me that I can write whatever I want, however long I want. So, I guess it’s a wash.


1 In desktop browsers the bookmarklet will copy whatever text is selected into the article body field. iPhone 3.0’s select doesn’t seem to work in the same way. No matter what is selected, the article body section is going to be blank on iPhone. Remember to tap copy first!

2 If instead of posting these links as articles you’d prefer to use the Link functions of Textpattern you might want to consider this bookmarklet from the Textpattern forums. I can’t speak for it personally, but I thought I should mention that it is possible.

3 The little ∞ links to the permanent link to this, ahh, link here on the site.

Tags

Welcome to the future

Jan 13 09

If you told me as a 10 year old that we would have devices like the iPhone I would not have doubted you for an instant. Of course we would have a sleek little device that fits in our pocket, allows us to communicate with (essentially) everyone in the world, and affords access to the complete sum of world knowledge (again, essentially). Not having an understanding of cellular telephony, computers, or the Internet certainly made this idea seem much more feasible when I was 10 than when I was 20.

A little over a week ago I got an iPhone. I’d wanted one since it was announced, but delayed my purchase due to the upfront cost, the monthly bill, and the slow death of my notebook computer to which it would sync. All of those issues became meaningless or were remedied with time. And now I have one.

And it is just like the future. Sure it’s built on a set of technologies found in many other wireless devices. And sure there have been smart phones for years that did many of the same things the iPhone does. They just don’t do them nearly as well1.

Now I am finally free to explore the wealth (or glut) of iPhone apps. As a follower of Apple news it was oftentimes very frustrating to continually hear about exciting new applications that ran on a platform to which I had no access. I’ll share my absolute favorite application today. It’s a little app called CameraBag and it’s terribly damned clever.

See, despite all of its advances, the iPhone still comes bundled with a pretty lousy camera that takes pretty lousy pictures like you would see from any run-of-the-mill mobile phone camera. CameraBag takes that flaw, and turns it on its head. It’s an app that takes a photo from the camera and applies one of a number of filters to it that emulate cheap cameras of the past. Suddenly your crappy mobile phone picture looks like a crappy snapshot that you found in your parent’s attic. They look a whole lot cooler that way. For $2.992 it makes taking photos with your little iPhone camera a whole lot more fun.


1 With the exception of email, I’ll grant you that. While the iPhone’s Mail application is functional, I’m sure it doesn’t hold a candle to that of a Blackberry, say.

2 If $2.99 is just far too spendy for you, they make a lite version for $0.99 that has the three most popular filters.

Tags

Preparing for iPhone

Jul 11 08

Now that I’m cleared maritally for iPhone ownership and plan to purchase one it seems I must make some effort to prepare. No, I will not be picking one up today. As it is now being treated as a standard phone and subject to the vagaries of phone subsidization I just cannot justify the expenditure of 200 extra dollars. My current plan allows for a discounted upgrade on September 29, 2008. Conveniently, this is one day after my birthday. The coincidence of this date does wonders to alleviate the pain of not being able to snatch one up immediately after over a year of waiting.

My preparations are rather long-term, actually.

It became apparent to me that I would have to consider the manner in which I read RSS feeds once I added a device like the iPhone. Some time back I chose NewsFire as my desktop RSS reader. I still stand by the choice purely based on design aesthetics alone. Everything in NewsFire is big, friendly, colorful, and obvious. It’s perfectly Apple-esque inasmuch as it does what it’s supposed to do without a lot of cruft. I’d recommend it to anyone and particularly to anyone new to RSS. It’s a wonderful program, but NetNewsWire has a huge ace in the hole: syncing.

NetNewsWire’s feeds can be painlessly and instantaneously synced to the web through a free web account available at newsgator.com. News items you read on any device — Mac, PC, iPhone, or web — will be marked as read on any other device. It’s all in that “cloud” you’ve heard so much about. I hear the newly released iPhone client is pretty damned good too.

So last I began in earnest to switch over. I could have imported my list of feeds from NewsFire in OPML format, but I deigned not to in order to weed out the less frequently read feeds. There were an awful lot of things I’d subscribed to and read almost never.

My first reaction was not entirely pleasant. NetNewsWire has a very staid, workmanlike appearance. It looks rather like an email client, which isn’t necessarily a bad thing but NewsFire is just so different.

I’m warming up to it very quickly though. It has some serious power under the hood, power I’ll likely never fully tap. For instance, in addition to the standard feed subscriptions, folders, and smart folders NetNewsWire allows a set of “Special Subscriptions” that allow the ad hoc construction of subscriptions to a search engine query, a local folder, a particular tag, or even a script. I will probably never figure out how to best use that functionality.

But the best feature of NetNewsWire I wasn’t expecting is the support of user-created stylesheets. This affords a phenomenal level of granular control of the way news posts are displayed. These are much more than simple CSS. They support JavaScript (if enabled in the Preferences) which, in the right hands, transforms raw XML into some of the best looking websites I’ve ever seen. In many cases the text visible in NetNewsWire is actually better looking than it is on the site from which it is derived. It ships with a bunch, and there’s a list of more user-created styles. I recommend the Ollicle Reflex and Bullit styles.

Forget “iReady,” this is how I prepare for iPhone.

Tags

In which AT&T gives me a swift kick in the nards as a reward for being a loyal customer

Jun 10 08

I was particularly keen to see the details of yesterday’s keynote as I had recently received the okay from the wife to upgrade my deceased iPod to a shiny new iPhone. While my desire to purchase one was never officially stymied by her, she had previously expressed a general disinterest in the product that was largely directed at the price1. I might have purchased an iPhone myself, but it would come bundled with a hefty serving of marital antipathy. It wasn’t as if I had the money at the time anyway.

In any event, when the iPhone 1.0 shipped last year I did not get one. I said I’d replace my iPod with one. Lo and behold, a few short weeks ago my 4G iPod up and died on me. “Such timing!” I thought to myself, “The new iPhone will be surely be announced in June.” And, as we all know, it was. Now I had a hat trick: dead iPod, wifely consent, and a brand new device. Not only that, but the release date just so happens to be a day I have off from work. This was kismet, assuredly.

I’ve spent the last few days in a buzz of excitement. The new iPhone is coming, and I’m going to get one.

And then, AT&T went and spoiled my buzz.

First, the new iPhone requires in-store activation. Opening day is doing to crawl. I don’t know if they’ve figured out some extra special way to move people in and out of the store, but I have never been able to get a new phone, activate it, and leave a store in less than 45 minutes. That even excludes shopping, as I knew precisely the phone I intended to get the minute I walked in the door. Second, they raised the price of a data plan, presumably to defray the cost of 3G2. Third, the subsidized price drop means I presumably will have to pay an undisclosed increased price as being a loyal AT&T customer without a 2G iPhone I am at the whim of AT&T’s upgrade policy. My date of eligibility is September 29, 2008.

What I don’t know, as mobile phone companies seem to thrive on this sort of obfuscation, is whether I could just sign a new contract and get the discount or if I can even buy an unsubsidized phone at all. It would appear that either way I’ll be getting an extension of my contract, which I don’t really give two shits about. It gets even more complicated when the type of plan I have is considered. Last year the wife and I made the ill-advised move to a family/shared plan, thinking it would save us money. It did not. In fact, we spend more now with a family plan than we had individually while getting fewer minutes. Thanks, assholes.

I’ll be getting one, AT&T shenanigans or no. I just wish this year’s sale could be more like last year’s.


1 A few years ago she expressed nearly identical opinions at length regarding the iPod before ultimately caving in and buying one herself. I think it’s a consumer defense mechanism.

2 A raise in price has the nasty side-effect of forcing much of the country to pay for a service they can’t have, as 3G coverage is far from universal.

Tags

All hail iPhone!

Jan 10 07

And we’re back! My apologies for the delay in updates. Over the course of the holidays my PowerBook decided she was tired of having two RAM slots and kicked the bottom one to the curb. This, apparently, is known issue with the 15 inch PowerBooks. Repair is out of the question due to financial considerations, even if I suspect my RAM failure is a direct result of the replacement logic board Apple installed in March. I’m currently trying to decide if I should buy a new 1GB DIMM card. 512MB of RAM is just not nearly enough to run Tiger as hard as I like.

This has tempered my interest in computing and thus my interest in posting. My apologies, dear reader, it’s just a painful experience to use a computer with too little brainpower.

Soldier on I must. Uncle Sam might just be able to buy me (and my wife while I’m at it) some new RAM once I get my W-2. I told myself I’d start seriously considering upgrading to a MacBook once the Leopard release is imminent and a 1GB DIMM might just carry me through.

It’s hard to keep the priorities straight after yesterday’s keynote though. I’m talking, of course, about the iPhone (not to say the AppleTV is not an attractive device for those of you with fancier televisions than I). My slavering desire for the iPhone is something terrible already. I’ve been excited at the prospect of a phone, any phone, with some smartphone capabilities that will effortlessly sync with my Mac for some time now. That the execution is as elegant as it is only makes the iPhone that much more exciting.

A funny thing I’ve noticed already is that most of the folks I talk to think of it as the new version of the iPod. One of the local “new rock” stations mentioned the iPhone this morning. Something to the effect of “If you got an iPod for xmas this year Steve Jobs has one thing to say to you, ‘Sucker!’” I suppose, from a money perspective it might be difficult to swallow the price of this iPhone had you just put down the money for an iPod. Hell, it might be difficult to swallow the price any way you look at it. It probably does signal a fundamental shift in iPod design. I’m curious to see if this “Multi-Touch” interface overtakes the iPod’s “Clickwheel” or if both can exist simultaneously.

As good as the new iPod interface might be it doesn’t really affect how I feel about the iPhone. I’d be just as excited about the iPhone if it played nary a single track and were just a phone/Internet device that synced with my Address Book and iCal.

Tags