Building Search Queries for Twitter’s REST API 1.1

I recently need to get a JSON object from Twitter’s API that had a couple of requirements. I needed the most recent tweets that contained a specific hashtag OR were from a specific user AND didn’t contain any retweets.

Starting with the base API URL for search

https://api.twitter.com/1.1/search/tweets.json

Then appending each piece of the search as required

https://api.twitter.com/1.1/search/tweets.json?q=from:example
https://api.twitter.com/1.1/search/tweets.json?q=from:example OR #example
https://api.twitter.com/1.1/search/tweets.json?q=from:example OR #example + exclude:retweets

Then a proper URL encode results in

https://api.twitter.com/1.1/search/tweets.json?q=from%3Aexample%20OR%20%23example+exclude:retweets

TIP: To find out what the URL should be after the ?q= do a search how you would like on https://twitter.com/search or https://twitter.com/search-advanced and copy of the tail end of the URL and stick it onto yours.

GitHub Release: TwitterRSS-Enchancer v2

https://github.com/cvanderlinden/TwitterRSS-Enhancer

Scope: Accesses the Twitter API 1.1 timeline status and authenticates with OAuth. Then takes each status and rewrites them to link @usernames to their profiles, #hashtags to their appropriate search, and links to their destination. Also includes time ago and author accreditation.

A much needed update to my TwitterRSS Enhancer. This version now includes OAuth, without the need for PHP OAuth libraries.

You need to create a Twitter application on to get your OAuth keys and access tokens. Once you have that, you can fill in the blanks on my PHP file. It will output the results to screen but of course you can redirect the screen ouput to a file either .rss or .html, then include it on your site where needed. I’ve also wrapped the output in some span tags for easy themeing.

The Simpsons: Tapped Out Sound Notifications

simpsons_tapped_out

I have a special place of disdain in my heart for games like Farmville. The Simpsons Tapped Out falls into that category. However, I do love The Simpsons so I thought I would try it out. It has some great original content but of course the whole point of the game is to buy donuts so you can build faster and do more things. Another money grab by EA. Oh well, that seems to be the way for these games and that is not what I am writing to complain about. Where my real gripe is with the sound notifications that come with the game that can’t be turned off. I’m also going to place a little bit of a blame on Android here because they also don’t provide an option to turn off sound notifications. Basically what happens is any time something completes in the game it pushes a notification and Homer chimes in with a little audio clip letting you know. This is a terrible feature. I don’t mind the notification the audio completely ruins the game and needs to be adjusted. I assume EA thinks it provides a higher level reminder for me to get back into the game and spend money, but all it’s done is made me uninstall the game. I try to like EA because I love some of their games (RE: The NHL Series) but they keep on disappointing and at some time in the future I am sure I am going to say enough is enough.

Please fix this EA, care about your customers for once.

If you want to complain to EA, here is a thread on their support forum

GitHub Release: CiviCRM Event Badge – Avery 5395 Letter Template

https://github.com/cvanderlinden/CiviCRM-Avery_5395_Letter_Badge

I found the default template file not working as it was set up for A4 paper and not US letter, which is the format of badge that we have. I adjusted the values to properly line up.

Easy install, just drop the Logo5395_Letter.php into /CRM/Event/Badge/ folder. Done!

Might need some fine tuning, but that is what GitHub is for, so fork me!

Craigslist/Classified Scam

I recently posted an add on an online classifed website similar to craigslist, UsedVictoria. Got this reply pretty quick from [email protected], no it’s not Leon Washington from the Seattle Seahawks like I originally thought.
The email starts like this

Hello Seller, I will like to know if this item is still available…
Thanks
- [email protected]

Interesting start, no specific mention of the actual item in question, just a general item.  I replied with

Still available.
- Craig

Keeping the conversation going.

I would like you to know that i am really interested in buying the item,I am
willing to offer you $xxxx  for it,However, I will not be able to come for inspection, all i need is your word
of sincerity that the item is in good condition as described online please let me know if you accept my offer
- [email protected]

His offer was $100 less than what I posted.  This is where I was 100% clued in that this was some sort of scam. Oh well, lets see where this goes.

I accept. Send me the money.
- Craig

And then his reply

Thanks for accepting my offer.I am a Chief Engineer on the sea and i am so busy as we are on assignment here and i need to get this for my Dad asap.I have a pickup agent that will come and pick the  car up in your resident or anywhere you want the pickup agent to come and pick it.. Due to where i am right now , i can only make payment through paypal , do you have a paypal account?if not you can open one at www.paypal.com Note:I am going to pay for the paypal charges fee.
Thanks
- [email protected]

To which I replied

I have a paypal account
- Craig

And his reply

Ok,Let me have your paypal account so that i can go ahead with the payment.
- [email protected]

It’s at this point where I stopped with this charade.  I don’t think there would be any harm in giving him my Paypal address to continue this conversation and see where it ends up, but also what’s the point? I suspect his next move would be to create a fake Paypal receipt showing that he sent the money and now it’s my turn to turn over the car.  I don’t know how often these scams actually work but I wanted to put it up on the Internet so people can be aware of these scams.

If you’re selling or buying an item online and it seems too good to be true. It probably is, don’t fall for these scams. Spread the word and report these people.

Android: Rogers MMS not sending or Rogers MMS not receiving

If you have an unlocked phone then often you’ll have to enter in your own APN settings. If you need the APN settings check out my post about Rogers APN settings.

Once you have that set up, you may notice that your MMS (picture messages, voice memos, etc) is not entirely working properly.  Here is what you can do to fix it.

  1. Open your dial pad and type: *#*#4636#*#*
  2. Then go to “Phone information”
  3. Scroll down and look for SMSC
  4. If it is blank try pressing “Refresh”
  5. Then press “Update”
  6. If refresh didn’t work, enter in (include the quotes): “+175057969300″,145
  7. Then press “Update”

Now try to send or receive an MMS message. It should work.

Photo: Tiny Planet Mount Douglas

Tiny Planet Mount Doug

Drupal: Remove double angle quotes from breadcrumbs

Built into Drupal core, in /includes/theme.inc the function theme_breadcrumb, automatically inserts » or » into your breadcrumbs.

The function looks like this:

function theme_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];

  if (!empty($breadcrumb)) {
    // Provide a navigational heading to give context for breadcrumb links to
    // screen-reader users. Make the heading invisible with .element-invisible.
    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';

    $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
    return $output;
  }
}

So if you want to change or remove the separator, all you have to do is redo this function in your template.php file within your theme. Make sure you rename the function THEME_breadcrumb, where THEME is replaced by the machine name of your theme. Here is an example where I replace the » with a space.

function THEME_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];

  if (!empty($breadcrumb)) {
    // Provide a navigational heading to give context for breadcrumb links to
    // screen-reader users. Make the heading invisible with .element-invisible.
    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';

    $output .= '<div class="breadcrumb">' . implode(' ', $breadcrumb) . '</div>';
    return $output;
  }
}

Now it will use this function instead of the core function, all done without hacking core.

Android: Easy Root Xperia Arc With A Locked Bootloader

Having a Sony Xperia phone with a locked bootloader makes flashing and rooting your phone a little more difficult and we have to find other ways to get around this. However, it is possible and this is what you want to do.

 

Get your Xperia Arc up to Android version 4.0.4, not 4.0.3, but 4.0.4. Important, you can do this by flashing it manually (Flashboot) or using Sony’s PC Companion to update it.

Now, you’re going to want to flash the firmware back to 4.1.B.0.431 (Ready To Root) with the following .ftf file.  This is for the Arc LT15i, but if you look around the Internet you can find the right files for the Arc S LT18i.

Mirrors:

Sorry, the file is so big (365 MB), but it’ll be worth it.
Use Flashboot 0.9.9.0 to flash the entire system, wipe data, wipe cache, everything. Start fresh.
After that is done, start up your phone to make sure everything is good.  When I did it on mine com.android.phone and Keypad kept crashing. No worries, that will be fixed later, when we flash back to a more recent firmware.
Now that you’re phone is ready to root, you need to run DooMLoRD’s Easy Rooting Toolkit for Xperia 2011 Devices V1
NOTE: There are other versions of this V2, V3, and V4.  However, I have found those don’t work, and that V1 is the one you need.
Follow all the directions and make sure those ADB Drivers for Xperia Arc/Arc S are installed.
After the device is rooted, you can flash another ROM using ROM Manager by ClockworkMod or Flashboot 0.9.9.0.
I recommend one of these Xperia Stock Firmwares if you are using Flashboot, otherwise pick your favourite maybe try CyanogenMod

Android: Rogers APN Settings

After you’ve restored some global stock firmware on your Android phone, it’s possible that the firmware won’t download your Internet/data/MMS settings properly for your carrier.  Here is what you need to do to get it working for Rogers (Canada)

If your Android phone’s MMS is not working, this will fix it

If your Android phone’s data connection is not working, this will fix it

  • Go to Settings
  • Under Wireless & Networks choose “More…
  • Choose Mobile Networks
  • Choose Access Point Names
  • Press the menu button and select “New APN
  • Enter the following settings, leave the rest as their default

Name: Rogers

APN: rogers-core-appl1.apn for 3G or ltemobile.apn for LTE

MMSC: http://mms.gprs.rogers.com

MMS Proxy: 10.128.1.69

MMS Port: 80

MCC 302

MNC: 20