Code Monkey home page Code Monkey logo

jsonderulo's People

Contributors

andrewmfraser avatar asanvery avatar jonhorner avatar pdincubus avatar romangetman avatar silentworks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jsonderulo's Issues

Error when running two Twitter feeds on one web page

I successfully set up a Twitter feed using the JSONDerulo snippet (2.6.0) in MODX (2.4.3). I wanted to show two separate Twitter feeds on the same page, so I created an app in the second Twitter account, created a new call to JSONDerulo with the new app details, tested it and it runs fine.

However, if I run both together on the same page, the page breaks: blank screen in FF, HTTP ERROR 500 in Chrome.

Checking my error log, I see:
[-date-] [warn] [client -IP-] mod_fcgid: stderr: PHP Fatal error: Cannot redeclare sksort() (previously declared in /[site path]/httpdocs/core/cache/includes/elements/modsnippet/65.include.cache.php:740) in /[site path]/httpdocs/core/cache/includes/elements/modsnippet/65.include.cache.php on line 740

I wrapped the sksort() function in the snippet in a conditional, as follows:

if (!function_exists('sksort')) {
   function sksort( &$array, $subkey, $sort_ascending ) {
      // Unaltered function code
      ...
   }
} 

and that solved the issue, at least to the extent that I am using the snippet (2x Twitter feeds).

Hope that's of help, but will be interested to know if there is a better way to call the snippet multiple times per page.

links, hashtags and @ sign into links in TwitterFeedNew snippet

Hi,

Thanks for this add-on. Im not sure if this is the right place to post this and if the code is clean, but anyway, i'd like to let you know that I change the code a bit so links, hashtags and @ sign get converted into links. Hereby the code. It took it from the montwitter add-on. Maybe it's useful for you or anyone else. At around line 58 I changed it to this.

$input = $message->text;

// Convert URLs into hyperlinks
   $input= preg_replace("/(http:\/\/)(.*?)\/([\w\.\/\&\=\?\-\,\:\;\#\_\~\%\+]*)/", "<a href=\"\\0\">\\0</a>", $input);
// Convert usernames (@) into links
$input= preg_replace("(@([a-zA-Z0-9\_]+))", "<a href=\"http://www.twitter.com/\\1\">\\0</a>", $input);
// Convert hash tags (#) to links
$input= preg_replace('/(^|\s)#(\w+)/', '\1<a href="http://search.twitter.com/search?q=%23\2">#\2</a>', $input);

$rawFeedData[$i] = array(
            'id' => $message->id_str,
            'message' => $input,
            'created' => strtotime($message->created_at),
            'picture' => $message->user->profile_image_url,
            'title' => $message->user->name,
            'username' => $message->user->screen_name,
            'retweetCount' => $message->retweet_count,
            'isRetweet' => '0',
    );

Instagram

Hi,

Is instagrams new API working in the latest version? I can't seem to get it to work.

Thanks,

Twitter Feed Blank

Hello,

Not sure what I might be doing wrong here (if anything), but my twitter feed is blank. I've got the most recent version of the extra installed and my app setup properly. It was working as of a couple weeks ago, but suddenly it's stopped generating anything (this may have coincided with my updating REVO to 2.2.8-pl...not sure).

Here are my code blocks:

[[!TwitterFeedNew? &tpl=TwitterFeedItemNew &limit=4 &cacheName=thefutureFWD &screenName=thefutureFWD &includeRTs=1 &consumerKey=&consumerSecret= &accessToken=&accessTokenSecret= &cacheTime=60]]

<li class="cf">
[[+id:notempty=`

  [[+isRetweet:is=`1`:then=`
  <a href="http://twitter.com/#!/[[+originalUsername]]">
    <img src="[[+originalAuthorPicture:phpthumbof=`q=85&w=48&h=48`]]" alt="[[+originalAuthor]]">
      <span class="userfullname">[[+originalAuthor]]</span>
      <span class="username">@[[+originalUsername]]</span>
  </a>
  `:else=`
  <a href="http://twitter.com/#!/[[+username]]">
    <img src="[[+picture:phpthumbof=`q=85&w=48&h=48`]]" alt="[[+title]]">
      <span class="userfullname">[[+title]]</span>
      <span class="username">@[[+username]]</span>
  </a>
  `]]

  <div class="tweet">
    [[+message]]
  </div>

  <a href="http://twitter.com/#!/[[+username]]/status/[[+id]]">
    <time datetime="[[+created:date=`%Y-%m-%d`]]">[[+created:date=`%e %B`]]</time>
  </a>

  <ul class="cf">
    <li><a href="https://twitter.com/intent/tweet?in_reply_to=[[+id]]" class="twitterReply">Reply</a></li>
    <li><a href="https://twitter.com/intent/retweet?tweet_id=[[+id]]" class="twitterRetweet">Retweet</a></li>
    <li><a href="https://twitter.com/intent/favorite?tweet_id=[[+id]]" class="twitterFavourite">Favourite</a></li>
  </ul>
  `:default=`
    [[+message]]
  `]]
</li>

It should be appearing in the "info tab" on the right, but I'm getting nothing:
http://thefutureforward.com

Let me know if you need any more info or have any thoughts on this!

Instagram

Has there been any thought into potentially integrating Instagram into this plugin?

I may need to do this, so if I do I will send over the code unless you have something in the works at all? Happy to discuss over email if you would prefer.

Many thanks,
Jonathan

Twitter Message

I have implement the extra and I am getting tweets coming through, but the [[+message]] appears to only allow a certain number of characters and I am finding the whole tweet doesn't appear. How do I increase the length of the message?

Issue when using 2 FlickrFeed calls

I think I found a bug unless I'm doing something wrong, I have 2 FlickrFeed calls one for a gallery with a limit if 65 and another one on the footer gallery with a limit of 15.

Both are calling the same gallery the problem I'm having is the one in the gallery is ignoring the limit of 65 I set and instead displays the 15 I set as the limit on the main footer gallery.

Let me know if I'm doing something wrong.

Here are my 2 FlickrFeed calls:

Gallery call:

[[FlickrFeed? &tpl=FlickrFeedItem3 &limit=65 &users=63094881@N04 &apiKey=******** &userName=ignitetampabay &cacheTime=30]]

This is my FlickrFeed call I have in my footer:

[[FlickrFeed? &tpl=FlickrFeedItem2 &limit=15 &users=63094881@N04 &apiKey=******** &userName=ignitetampabay &cacheTime=30]]

You can see the live sample here:

http://2013.ignitetampa.net/gallery.html

Thanks for this great plugin it's pretty awesome.

output modifiers such as "default" do not work on V2 of JSONDerulo

I am trying to add default text for when a Google Calendar has no upcoming events, however, the following is being ignored:

[[JSONDerulo:isempty=<li>There are no events scheduled at this time.</li> ?
&feed=googlecalendar
&tpl=googleCalendar-tpl
&limit=5
...
..
.
]]

jd.googleCalendar Chunk

When I change [[+title:neq=No events.:then=CHUNK:else=[[+title]]]] to something more informative like "There are no events at this time", the full chuck will show with empty fields.

How to create API key for Google Calendar?

Hi there,

Recently Google changed the way how to create an API key. I've tried to create all kinds of keys in the developer console, but I can't make the calendar to work. It worked fine just before the introduction of the key variable. Can anybody tell me how to create a key which can be used? I'm confused.

[[!JSONDerulo?
&feed=`googlecalendar`
&limit=`25`
&cacheTime=`1`
&cacheName=`kalender2`
&feedLocation=`[email protected]`
&apiKey=`AIzaSyCoSCfxxx-CHZU9uQpltuxxxxx`
&tpl=`google-calendar.feed.tpl`
]]

Accentuated chars break hashtags

Accents break twitter hashtags (French words).
May I suggest you to change Regex at line 900 in Snippet: JSONDerulo?

From:
$input= preg_replace('/(^|\s)#(\w+)/', '\1#\2', $input);

To:
$input= preg_replace('/(^|\s)#(\w+)/u', '\1#\2', $input);

Thanks for your extra!

Incorrect start and end dates in google calendar

Small issue with the google calendar dates:

'eventEnd' => strtotime($event->start->dateTime),
'eventStart' => strtotime($event->end->dateTime),

a pretty obvious fix, just FYI for your next update.

Google Calendar: date not shown with all day events

Hi,
first of all: thanks for this great snippet!
However, I have problems with all day events. Their title is shown, but not the date ([[+eventStart]]). If it's an event with starting/ending time given (like 4-5pm), everything is OK.
Here's my snippet call:

    [[!JSONDerulo? &feed=`googlecalendar` &tpl=`jd.googleCal-sas` &limit=`6` &feedLocation=`[email protected]` &apiKey=`12345` ]]

and my chunk

  • [[+title:neq=`No events.`:then=` [[+eventStart:date=`%d.%m.%y`]]
    [[+title]] `:else=`Momentan keine Termine.`]]
  • Regards Chris

    Noob Questions...

    sorry in advance if these questions are too noob for you, but i'm having a little trouble understanding / finding info/instructions on some of these things. i do know HTML/CSS. getting started learning JS/JQuery. & new to ModX Revo. so i respectfully request your patience & acknowledgement on these things.

    i'm trying to embed a Tumblr blog into a ModX site. before finding your modx addon, i was attempting to hack together whatever i could find using Jquery/Ajax & the Tumblr API. it's been a challenge to say the least. in hopes that this method would be easier & more efficient & flexible, i installed your addon & copied this code from your readme...

    <ul>
        [[!JSONDerulo?
            &feed=`tumblr`
            &tpl=`jd.tumblr`
            &limit=`LIMIT`
            &cacheTime=`CACHE_TIME_IN_SECONDS`
            &cacheName=`UNIQUE_NAME_FOR_CACHE_FILE`
            &tag=`TAG TO FILTER BY`
            &postType=`POST TYPE TO FETCH`
            &notesInfo=`TRUE or FALSE`
            &blogUrl=`YOUR TUMBLR URL`
            &apiKey=`API KEY`
            &random=`1 OR 0`
        ]]
    </ul>
    

    ...into a new page/resource.

    1) &limit - i'm assuming this means "how many posts to show/embed/get". if so, no matter what number i put in there, it still pulls in all of them (which is only 13, because that's how many test tumblr posts i've made thus far). am i missing something here?

    2) &cache* - i'm not understanding what these 2 properties mean. if it has anything to do with how often the feed is updated, i'd like it to show new blog posts immediately when made on tumblr.

    3) &blogUrl - am i to include the "http://" part here, or just the "blogname.tumblr.com"?

    note: i "did" successfully go thru the steps to aquire the blog API KEY.

    4) &random - does this mean to not have the posts sorted? if so, which does the 1/0 represent (assuming they represent Yes/No)? and if 'no', then hoping the sort order will be "most recent on top".

    5) STYLE - is there a way to pull in the tumblr theme style with the feed?

    6) FLASH - i did a tumblr blog post for each of the 'types' in an attempt to test all the options to make sure they come thru ok. i've noticed the "Audio" post embeds the audio in an old FLASH player. do you know how i can change this to be an HTML5 player instead?

    7) VIDEO - i found why 1 youtube video was embedded 3 times of different sizes... can i make my own size for the embed by changing [[+player500]] to say [[+player450]] or other number?

    8) IMAGES - since the images brought over is just the url to them, would i add the needed HTML/CSS in the tumblr Chunk file to have them be shown, or is there another method i'm not finding?

    9) LINKS - link posts on tubmlr shows a preview image of the link; any way to get that brought over too?

    10) TYPES - in looking at the tumblr chunk, it's only showing 5 of the 8 post types (missing Quote, Chat, & Answer). to add the other 3, would i (for example) copy the section for Text posts, then change the eq=text to eq=quote, and change +title to +text and +content to +source (& follow suite if more/less options)?

    again, sorry for the length & beginner-level questions. if this is too absurd to answer, i understand. if not, i thank you for your time & expertise & kindness.
    -jason.

    Google plus fullImage

    I'm trying to get the fullImage url to load, when I load up the json feed in browser the field is populated. However when I try adding 'fullImageUrl' => $message->object->attachments->fullImage->url, to the rawfeeddata array in you snippet I can not get the url to show up..

    Trouble with youtube playlist

    Hi, I am having some issues setting up the youtube v3 playlist. Not sure if I have configured my API Key incorrectly, since I have otherwise followed the example. I activated my YouTube v3 API, and have tried with both browser and server keys. Any guidance you could offer?

    Twitter PHP Error

    Hi, am only using this extra for twitter but am getting a lot of the following errors in the modx log:

    (ERROR @ /core/cache/includes/elements/modsnippet/85.include.cache.php : 751) PHP warning: Illegal string offset 'created_at_timestamp'

    Line 751 is:

    if(!$found and strtolower($val[$subkey]) > strtolower($tmp_val[$subkey])) {

    Haven't got time to look into this right now, just wondering if anything stands out that could be causing error?

    Add Random property

    I think this extra could benefit from having a random functionality, for example in the FlickFeed snippet if I wanted to display a random image on a page each time it was loaded.

    Something like &random=1 that you can turn on or off.

    Anyways keep up the good work the extra is awesome, just wish I could contribute more but my PHP skills are n00bish.

    Google Calender

    Can not get the snippet to pull any calender events. Running modx 2.3.1 and the latest version of this plugin. Any help is appreciated.

    FR: Sort order

    Hi guys,

    This is actually a feature request.

    We needed to switch the order that tweets were displayed on the website (by default it is in descending order) as we needed the latest tweet first.

    We found this line and set to true to get the desired effect:
    sksort($tweets, 'created_at', false);
    sksort($tweets, 'created_at', true);

    Would be great if there was an option to assign to the twitter call and set true or false for ascending order. I could do this when I get a little more time if needs be.

    Regards,
    Jon

    Custom Json feed

    Hi and thanks for this plugin.

    Is it possible to use it to import a custom Json feed into Modx ?

    Make cache time configurable

    Thanks for JSONDerulo. Just swapped out the broken getFeed twitter-getter thing on my site with TwitterFeedNew from this package in a few minutes :)

    One thing I notice is that the cache time is hardcoded to 12 hours, but as a twitter fanatic like myself I'd prefer lowering that to 1 or 2 hours. If this was configurable through a snippet property, that'd be possible without having change the snippet and losing clean upgrades :)

    instagram feed not working?

    Am able to pull all other feed through apart from instagram - have followed instructions and created a client ID

    Can you confirm if this is still working and how can i debug to see whats not pulling through correctly?

    Thanks

    Google agenda sort order

    You must hate me by now... anyways... It would be nice to have the items to show up with the [[+eventStart]] as method of sorting, first event etc...

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.