Blog

PHP: Importing Remote XML To an Array

XML. Your friend, your enemy. Perhaps it’s overused, but do enough work with a few 3rd party systems and you’d better have a solution for throwing XML into an array.There is a potential misuse of fopen() to call external XML’s and many hosted service providers will forbid you from using it to call external files. Therefore, I humbly suggest using CURL to do your dirty work. It’s a few extra lines of code, but it’s worth it.


//the location of your external XML file. Basic HTTP Auth can be added if necessary
$url = “https://someurl.com/somefile.xml”; //grab the XML and save it to a temp XML file
$ch = curl_init($url);
$fp = fopen(“temp.xml”, “w”);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);

//Load the local XML that was created in the above CURL call
$xml = simplexml_load_file(“temp.xml”)
or Die (‘ERROR: Could not load file’);print_r($xml);

Read more...

TwitSlap

Sometimes, people just don’t know when to shut up…especially on Twitter. So, Slap them. No no. TWITslap them!https://www.twitslap.com

Only took me an hour or so. Needs some new features and a new design, but it works. I’ll shine it up a bit in the coming weeks.

Read more...

Using Phpbb3 Avatars In Custom Pages

Recently I've been working on a custom web app that integrates with phpbb3. In this app, I'd like to have a custom user profile page. I have my own 'users' table and the link between the two is the "user_id" field which I set when the user first enters the app. Throughout, however, there are "Submitted By:" sections with links to the user's profile page.On said profile page, I'd like to show the user's avatar straight from phpbb. This took some hackery, but I finally got it working. Behold.First off, if you're not already doing phpbb session management, here's that code. This requires your phpbb user to be logged in:define('IN_PHPBB', true);//replace $phpbb_root_path with path to your forum<

Read more...

Caught in the Act

Poor Kid. I knew you could get stuck in those things, but I figured only an arm…not your whole…person.

Read more...

Revision3 Launches Mobile Website

After an announcement pre-Christmas about signing with Transpera to do a mobile WAP site, it seems it’s finally launched! All Revision3 shows are now on mobile — https://m.revision3.comDigg:
https://digg.com/tech_news/Revision3_launches_mobile_website_http_m_revision3_com

Revision3 mobile:
https://m.revision3.com

Read more...

iPhone Browser Simulator

i’m making some iPhone WAP designs and needed to see how they’d look without actually buying an iPhone (another one, that is). i’m using the user agent of the iPhone to switch the layout designs.there’s iPhoney for the Mac, but i got moved to a PC recently, so it’s a little trickier. there’s iPhonetester.com, but it passes my firefox user agent and the site won’t switch. so here’s the workaround:


  • open Firefox

  • install this add-on: https://addons.mozilla.org/en-US/firefox/addon/59

  • add this user agent: iPhone, User Agent: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en), App Name: AppleWebKit/420+ (KHTML, like Gecko), App Version: Version/3.0, Platform: Mobile/1A542a Safari/419.3

  • switch to this user agent, and view your website (either in Firefox to view full screen, or browser to iPhonetester.com to view in a iPhone mask)

Read more...

hydroplane

hydroplane. v.
To be or go out of control by skimming along the surface of a wet road. Used of a motor vehicle.

so after a nice day of climbing in joshua tree with sensei, golfer, jill, and jcpeace (josh), everyone went their separate ways. freezing and hungry, i went back to my campsite. as i sat by my tent, trying to get a fire started with wet wood and sipping my cup o’ noodles, i thought, “maybe i should just go home. i had a day climbing, it’s probably gonna rain Sunday. i’d like to sleep in a real bed.”

“no! this is your last climbing trip before the baby comes! plus, you already paid for the campsite. suck it up and climb!”

around 10pm the winds started. my tent was on a bed of rock, so i neglected to spike it down. the rocks on the corners didn’t help, and around 11pm, my tent collapsed.i struggled to get out of my sleeping bag and put on my jacket. i piled all my belongings into the back of my tiny car, laid down the seat, and contorted my body enough to lay down and sleep. the car rocked back and forth in the wind for the rest of the night.

at 7am, i woke up. the wind was still howling and the clouds were rolling in from the west. i sat in the back of my car trying to think of a sheltered place to climb. i drove out to Hall of Horrors, walked around, and decided to call it a day. i left the park, experienced the worst ever customer service at the Denny’s in Yucca Valley, and started down towards the 10.

The rain was pouring, and I could barely see 50 yards ahead. I was doing fine, trying to stay focused on the dashed white lines flying by. 10-west, just before california st. in Redlands, i hydroplaned. i did about two 360’s, bounced off the center divide, did two more 360’s and slammed head-first into the center divide. my car was totaled, i was shaking uncontrollably, and somehow my Joshua Tree park pass had jumped from my center console to the side pocket of the drivers side door (amazing physics).

no car rental places are open in this great city of Redlands. so now i’m sitting in the lobby of a Howard Johnson below the freeway, waiting for my father in law to drive up from San Diego and pick me up. he’ll drive me to SD where my wife is this weekend, then we’ll make the 2 hour drive back to LA tonight.

sucks.

lesson learned: if you already had a great day of bouldering, and the next day it will probably rain, and you’re alone, hungry, and only 2 hours from a warm bed and hot food…go, man. just go.

signing off from the HoJo,

jon

Read more...

Setting up the Sony Ericsson P1i on ATT

PLEASE NOTE THAT THIS ARTICLE WAS FIRST PUBLISHED IN JANUARY 2008. I NO LONGER OWN THE SONY P1i AND CANNOT GUARANTEE THAT THESE INSTRUCTIONS ARE UP TO DATE.


I recently purchased a Sony Ericsson P1i for work. My days of living with a Verizon phone — horribly crippled of all of its cool features — were over. I bought it off Amazon, took it to the AT&T store, got my SIM card…and was told “Uh. You can purchase the data and messaging plan, but since it’s not an AT&T device, I can’t help you set it up.”

huh?So come to find out AT&T throws what seems like a pity party. “You didn’t buy the phone from us, and it doesn’t have our branding! Booooo! You can setup the phone yourself!”

Fine, I thought, I’ll just go back to work, look up the settings online, and boom. No problem. Trouble was, the settings I found on forums were either too old to match my situation or were not quite what I needed.So here ya go, P1i user…(or other SE unlocked phone user) … here are the settings to get you started:

WAP
Use the Sony Ericsson P1i setup: HERE.It’s *crucial* you use this tool. Entering this data manually doesn’t seem to work for me and will affect MMS settings later.

MMS

  • Go to: Main Menu > Control Panel > Messaging > MMS Account

  • Under “Service Center Address”, enter: “https://mmsc.cingular.com”


(The other settings don’t seem to matter. I have mine set to: “Auto Download: Home Only”, and “Download Size: No restrictions”)SMS

  • SMS Service center address: +13123149810


That’s it! I had a problem where I could send SMS’s out, but could not receive them. I had to call ATT customer support (and have them tell me they couldn’t fix my device cos it wasn’t ATT branded). After some sweet talking, she had me read her the IMEI number (press *#06# on your SE phone). I pulled my battery and SIM card, rebooted, and whatever she did with my IMEI number worked. It seemed it was a network provisioning error.

If this doesn’t work for you, leave a comment. I’m (hopefully) pretty quick at answering.
Enjoy! And happy phone-ing!

Read more...

San Francisco Wifi

while cruising from the SFO airport to our SF office in the financial district, my EVDO card had a freak out. i was right in the middle of sending an important email, so i decided to see what my wifi card would bring me.

i remember some article back in the day about possible city-wide wifi in San Fran — I guess that never happened. However, what was incredible was the amount of wireless networks filling up my list as I drove through the city. I’m sure there are places in downtown with a higher concentration, but this was by far the most i’d ever seen in my list:

Read more...

Hi there, I'm Jon.

Writer. Musician. Adventurer. Nerd.

Purveyor of GIFs and dad jokes.