Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

error for a non-responsive Twitter

  • Loading branch information...
commit caaaef94127098bda55ba9f0ff77af17f31bfb0c 1 parent 673132b
Brennen Bearnes authored
Showing with 5 additions and 1 deletion.
  1. +0 −1  SocialNoise.php
  2. +5 −0 SocialNoise/Twitter.php
View
1  SocialNoise.php
@@ -18,7 +18,6 @@ class SocialNoise {
public static function getSearchFromJson ($url)
{
$search = function () use ($url) {
-
// humbly submitted: this is a stupid interface.
$ch = curl_init($url);
curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1);
View
5 SocialNoise/Twitter.php
@@ -1,6 +1,8 @@
<?php
namespace SparkLib\SocialNoise;
+use \SparkLib\Fail;
+
/**
* This is based on:
*
@@ -39,6 +41,9 @@ public static function searchHTML ($text, $qty)
$url = 'https://search.twitter.com/search.json?q=' . rawurlencode($text);
$searchResults = static::getSearchFromJson($url);
+ if (! $searchResults)
+ return '<p>Search failure.</p>';
+
// Set up our string format templates
$img = '<img src="%s" height=48 width=48/>';
$bold = '<b>%s</b>';
Please sign in to comment.
Something went wrong with that request. Please try again.