20
Feb
2015

Generate bit.ly Short URLs with PHP

posted Friday, February 20th 2015 at 8:40 AM by

Generate bit.ly Short URLs with PHP

Need to shorten URLs automatically for your website (or automated Twitter feed)? No problem, bit.ly has a neat API that you can connect to via PHP!

Continue Reading...

Tags:

Comments:

View (3) Comments Post a Comment
  • Replying to Adam Konieska on Generate bit.ly Short URLs with PHP







  • kirk ward
    Kirk Ward
    Monday, May 18th 2015 at 6:47 PM

    I'm trying to use the bitly.php as described, using the function and the example URL inside a Wordpress page. All goes well until I try to echo the bit.ly shortened link. The message I get is "Array."

    You can see my result at http://practicebuilderpublishing.com/code-test

    The URL above the bitly.php output is the typical dynamic URL I want to shorten, using bit.ly and bitly.php.

    Can you advise me as to where I have an error?

    Or, has bit.ly changed their api since the post was written?

    Many thanks
    Kirk Ward

    P.S. Are you the developer? (I have a hard time figuring simple things like this out. I'm starting to use age as an excuse.)

    • Replying to Kirk Ward







    • Adam Konieska
      AK
      Wednesday, May 20th 2015 at 3:12 PM

      Hey Kirk! The first thing I'd check would be the API keys and the bit.ly account.... but it looks like you've already got it working from our email exchange. Nice job! If you need anything else, just drop me a line!

      • Replying to AK







  • ramon michael
    Ramon Michael
    Thursday, December 17th 2015 at 11:44 AM

    Thanks for the very helpful tutorials Adam, this one as well as the auto posting to Twitter one. Both are very well explained with nice screenshots.

    • Replying to Ramon Michael







16
Feb
2015

Post to Twitter Via API Using Codebird-PHP

posted Monday, February 16th 2015 at 8:57 AM by

Auto Tweet Using PHP

Do you have a website with frequent updates? Maybe you're driving traffic to those updates via Twitter? Push those updates directly to Twitter via the API and PHP!

Continue Reading...

Tags:

Comments:

View (14) Comments Post a Comment
  • Replying to Adam Konieska on Post to Twitter Via API Using Codebird-PHP







  • rendy
    Rendy
    Monday, June 29th 2015 at 1:41 AM

    It's working with my localhost, but when i upload to my website, why it doesn't working. Thanks, please reply to my email.

    • Replying to Rendy







    • Adam Konieska
      AK
      Monday, June 29th 2015 at 10:13 AM

      Aww shoot. I'll send you an email and hopefully we can troubleshoot it!

      • Replying to AK







      • test
        Test
        Wednesday, November 4th 2015 at 6:56 AM

        Nice Post

        • Replying to Test







  • james
    James
    Sunday, July 12th 2015 at 9:29 AM

    "You'll need these for the next step in configuring Codebird." - What next step? I seem to be missing something, which may be causing the following problem:

    When I run the tweet() function above it displays codebird.php as a webpage.

    • Replying to James







    • james
      James
      Sunday, July 12th 2015 at 10:21 AM

      Never mind! :)

      • Replying to James







  • anders
    Anders
    Saturday, September 12th 2015 at 10:05 AM

    Cool! Works perfectly. How do you tweet like this with a image? :-) Thanks!

    • Replying to Anders







    • anders
      Anders
      Saturday, September 12th 2015 at 2:28 PM

      Nevermind, found your other post that describes tweeting with image :)

      • Replying to Anders







      • Adam Konieska
        AK
        Saturday, September 12th 2015 at 2:55 PM

        Awesome Anders, glad you found it. Here's the link if anyone else is also looking: http://www.adamkonieska.com/archives/tweet-images-via-api-using-codebird-php/

        • Replying to AK







  • gary
    Gary
    Wednesday, November 11th 2015 at 9:25 PM

    THANK YOU! I've been trying for a while to find a script that does this easily. Yours works like a charm!!

    • Replying to Gary







    • Adam Konieska
      AK
      Thursday, November 12th 2015 at 8:24 AM

      Thanks Gary! That's awesome to hear.

      • Replying to AK







  • david
    David
    Thursday, March 3rd 2016 at 1:02 PM

    I got codebird.php to work but it's sending posts automatically without me having to create a cron job. Where in the code can I change the time of the auto posting?

    Thanks.

    • Replying to David







    • Adam Konieska
      AK
      Thursday, March 3rd 2016 at 5:40 PM

      Hey David. The code (as shown here) wouldn't run on its own. The code would do a tweet every time the tweet() function is executed - so if someone is accessing a URL that causes the script to run, it would post. If you wanted to set something to post at a specific time you could do it using a cron job.

      Hope that helps!

      • Replying to AK







  • malik
    Malik
    Friday, August 5th 2016 at 7:37 AM

    I want to post a tweet on behalf of my website users. They have already give me auth_token and auth_token_secret but the obove code is not working for it. and the Error is HTTP_CODE is 401.

    • Replying to Malik







    • Adam Konieska
      AK
      Friday, August 5th 2016 at 1:58 PM

      Hey Malik, the 401 status code is a pretty good indicator that there is a problem with your auth credentials. More details on the 401 status code.

      • Replying to AK







2
Jan
2015

Life Hack: USB Edition

posted Friday, January 2nd 2015 at 8:37 AM by

Schrödinger's USB
Schrödinger's USB

A USB has three states. The up state, the down state, and the super state. It remains in the super state until observed. But there is a way around it, here's how you can stick it to Schrödinger's USB stick.

Continue Reading...

Tags:

Comments:

View (0) Comments Post a Comment
  • Replying to Adam Konieska on Life Hack: USB Edition







30
Dec
2014

Happy 1420070400! (a.k.a. New Year)

posted Tuesday, December 30th 2014 at 8:57 AM by

Linux New Year!

Happy 1420070400 everyone! Thats the Unix Timestamp for New Years. Which is kind of neat.

What's also pretty neat is the history of Linux. It's the story of an ambitious Finn with too much time on his hands...

Continue Reading...

Tags:

Comments:

View (0) Comments Post a Comment
  • Replying to Adam Konieska on Happy 1420070400! (a.k.a. New Year)







17
Dec
2014

Scraping Images from a Website in PHP

While working through some SEO enhancements for Homebräu, like building Sitemap with images, I needed to find a way to gather all the images on a page and return them nicely. I also needed to use this logic in a couple places, so it needed to be flexible.

Here is tutorial for creating a script that will scrape a page or HTML string for images, and return all of their src attributes. Let's look at the PHP first...

Continue Reading...

Tags:

Comments:

View (1) Comments Post a Comment
  • Replying to Adam Konieska on Scraping a Website for Images with PHP to build an Images sitemap.xml







  • sunny techo
    Sunny Techo
    Saturday, July 9th 2016 at 1:51 AM

    There is correction in function "scrapeImages"
    because its always return empty array.
    In this line,
    array_push($img,$image->getAttribute('src'));
    Improve
    array_push($imgArray,$image->getAttribute('src'));

    • Replying to Sunny Techo







8
Dec
2014

How to Fetch a Gravitar Image With PHP

posted Monday, December 8th 2014 at 8:45 AM by

Gravitar Icon

When I added Gravitar support for Homebräu I ran into a little hiccup for users that didn't have a Gravitar image. I needed to find a way to check to see if a Gravitar image exists in PHP, then stop Gravitar from returning the default image, which is just the boring Gravitar icon.

I managed to work it out by...

Continue Reading...

Tags:

Comments:

View (0) Comments Post a Comment
  • Replying to Adam Konieska on How to Fetch a Gravitar Image With PHP







3
Dec
2014

Gravitar Support - Built Into Homebräu

posted Wednesday, December 3rd 2014 at 8:06 AM by

Gravitar Image Example

Comments are an important part of blogging, and after recently improving spam controls and filtering, we've got something for the human posters this time — support for Gravitar Icons.

Continue Reading...

Tags:

Comments:

View (0) Comments Post a Comment
  • Replying to Adam Konieska on Gravitar Support - Built Into Homebräu







28
Nov
2014

Google PageSpeed Insights

Everyone knows about minifying javascripts and CSS to reduce load times, as well as image compression techniques and caching. But how well is your site actually performing?

Fortunately, Google's PageSpeed Insights will not only test your site and rate its performance, but also give you tips on which areas of your site can be sped up. The really neat part is Google will tell you how much data you can save in each area, which really helps you know which areas to target to optimize performance.

Continue Reading...

Tags:

Comments:

View (0) Comments Post a Comment
  • Replying to Adam Konieska on Using Google PageSpeed Insights to Optimize Your Site's Load Time







20
Nov
2014

Add Images to Your Sitemap.xml

posted Thursday, November 20th 2014 at 8:05 AM by

Dilophosaurus recommends including images in your Sitemap

I wrote a quick blurb about how Sitemaps help SEO, and why your website should have a sitemap.xml file. This is a quick add on to cover something we didn't talk about in the first article: including references to images in your sitemap.

The first thing to note about including images in a Sitemap is that...

Continue Reading...

Tags:

Comments:

View (0) Comments Post a Comment
  • Replying to Adam Konieska on Add Images to Your Sitemap.xml







18
Nov
2014

New Geocache and Munzee Social Badges

posted Tuesday, November 18th 2014 at 9:38 AM by

Munzee Achievement Badge
Geocaching Achievement Badge

Check it out ya'll, new social badges for Munzee and Geocaching achievements. I've been having a lot of fun doing these lately. Its cool because...

Continue Reading...

Tags:

Comments:

View (0) Comments Post a Comment
  • Replying to Adam Konieska on New Geocache and Munzee Social Badges