Coder Social home page Coder Social logo

bird-docs's People

Contributors

danieldevine avatar edent avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

edent

bird-docs's Issues

Error in sample code - missing parens after search methods

I was excited to find BirdElephant, looks like a great tool for a project I'm working on. However, as I was just getting my feet wet, I got frustrated just trying to run the sample code on https://birdelephant.com/tweets. Specifically, this line:

$tweets->search->recent($params);

was resulting in the errors:

PHP Notice: Undefined property: Coderjerk\BirdElephant\Tweets::$search
PHP Fatal error: Uncaught Error: Call to a member function recent() on null

Perhaps to most people the problem is immediately obvious, but it took me some hair-pulling and code-searching to realize that the sample code really should have been

$tweets->search()->recent($params);

That is, there should be a pair of parens after "search". It looks like several other bits of sample code on that page have the same issue, for instance

$tweets->count->recent($params);

(I didn't do a thorough search for other examples of the problem. There are likely several others.)

Unrelated issue: I think it would be helpful if the sample code in the docs gave examples of how to actually use the results of the method calls. So maybe something like:

echo $tweets->count()->recent($params)->meta->total_tweet_count;

and going back to search, something like

foreach ($tweets->search()->recent($params)->data as $t) { echo $t->text . "\n"; }

Obviously, I was able to figure this stuff out using var_dumps and the like, but having it more apparent in the sample code would definitely be helpful.

Thanks again for your work on this! Now that I'm over these hurdles, I'm excited to start using BirdElephant in my work!

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.