Download the PHP package brandonshar/stack-overflow-buddy without Composer

On this page you can find all versions of the php package brandonshar/stack-overflow-buddy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package stack-overflow-buddy

Stack Overflow Buddy

Inspired by the revolutionary work done by @drathier and their stack-overflow-import, Stack Overflow Buddy is your own personal PHP based Stack Overflow assistant!

Why spend your valuable time cutting and pasting from StackOverflow when Stack Overflow Buddy can do it for you? Who wouldn't trade all safety checks and only the basest of functionality checks for a bit of convenience?

Installation

Because Stack Overflow Buddy uses untagged libraries, you may need to add the following lines to your composer root


What's it do?

Just give it a try!

Impressed?

How about


Wow, how's it work?

If you're impressed, you should probably stop reading here.

  1. Split the camelCased function call into words
  2. Grab the top scoring PHP tagged questions with those words in the title from StackOverflow's API
  3. Grab the top scoring answers for those questions
  4. Pull any and all code blocks from those answers
  5. Find the first code block that:
    1. Inteprets without error
    2. Contains one or more functions
    3. One of the functions has the same amount of arguments as were passed by the user
  6. Then we throw caution to the wind, eval, and call the new method!

    Wow, this will change my workflow forever!

    It certainly will. But don't forget to use some of that time you're saving to thank the original author of the code you've now absorbed.


What if StackOverflowBuddy can't find any good code for my method?

In the incredibly unlikely (ok... maybe not incredibly unlikely) event that StackOverflowBuddy can't find any code that meets your request, it'll throw you a HaveToWriteYourOwnCodeException to keep you busy while hopefully someone else gives a better answer on Stack Overflow.


Testimonials

If you're still on the fence, don't take my word for it; here's what a satisifed reader of the code had to say:

"I love how this makes on the fly software updates really easy. If I ever need to tweak an algorithm or fix a bug, I just need to submit a really good answer to stack overflow with the updated code. Goodbye source control!"

- Pseudofailure

Warning-ware

You're free to use this package, but if it makes it to your production environment you accept the responsibility of personally telling each of your users that they would be better off hiding their data under their mattress.


Notes

Keep in mind that every usage of this makes two requests to the StackOverflow API and they will rate-limit you after a certain number of requests per day. But that shouldn't really be an issue since no one sensible would ever use this for anything.


Contributing

Have a blast. There is currently only one end to end integration test that requires the index.php file to be reachable from a local server. I just used Laravel Valet. This code does not follow PSR-2 and deliberately uses no typehints or visiblity as I decided to do a similar style experiment to the required Zttp library. Even if you're the strictest PHP writer there is, not following a style guide is at best, like the 5th reason you should never use this code.


License

The Unlicense. If there's a less restrictive license with even less liability, let's go with that. Anyone who thinks that using this license is to the detriment of my heirs clearly didn't look at it very carefully.


All versions of stack-overflow-buddy with dependencies

PHP Build Version
Package Version
Requires php Version >=7
nikic/php-parser Version ^3.1
kitetail/zttp Version dev-master
tightenco/collect Version ^5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package brandonshar/stack-overflow-buddy contains the following files

Loading the files please wait ....