How to integrate messages from Slackbot on the site? - php

There is an account on the slackbot. There is a bot that sends me data every 2 minutes, in the form of text and links, after receiving this data, I need to display them on the site. Website on Html + PHP how to do this mind I will not put it. I know that somehow through Api is done, but I do not guess. Can anyone have examples? Thank you

It is very simple. Just follow one of these top tutorials: https://api.slack.com/tutorials
Also take a good look into the api documentation:
https://api.slack.com/

Related

Developing REST API using PHP

I am new in API. I am supposed to develop an API that allows our content provider to give information pertaining soccer whereby he is supposed to create matches,update matches etc .I would like to know how to create a REST API in php that allows a client to enter the information. So far,I have created an API but I dont know how to enable the client enter the information.
Informations:
It is the basic form that you have to create and then you must allow the user to submit the form datas that he/she has filled and you have to post the data to the route that you have created.
You must submit the data and then you have to make the submitted data to be json_encode() so that it will work for the API.
Or Else if you are not designing the form and other such things you can directly go in for the API ADD ONS that the Firefox and the chrome has . Assuming you are using the chrome or Firefox as browsers.
https://addons.mozilla.org/en-US/firefox/addon/restclient/
https://addons.mozilla.org/en-US/firefox/addon/rest-easy/
https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en
Okay, assuming that you created a REST API already, download the Advanced REST client chrome extension: https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo
I hope that answers to your question.
P.S: May I know what framework did you use to design your REST API ? Additional details can help you further.
Building REST APIs is atually a rather easy task. That's primarily what I work on at work all day. If you have to use PHP (I'm a fan of PHP, so don't take that comment the wrong way :) ), I would reccommend using a framework like Laravel.
The logic to handle the information once it's requested wouldn't change. You would just need to make your requests/responses REST compliant.
Here is a great tutorial for doing just that!
Also, since you use Yii, this tutorial is probably better. I've never used Yii, so I can't really vouch for it, though.

Generate SIMPLE Paypal buttons dynamically with PHP

I wanted to add PayPal functionality to my Wordpress plug-in, so I ventured over to PayPal's developer page and scanned through it. I couldn't help but notice how vague and complicated their documentation was.
On their button manager API page, step 4 literally says " ... develop the API code necessary to create and manage your buttons." This is not helpful whatsoever. With a little more digging, I found this PHP SDK, but implementing it is poorly explained and I can't follow it. To be honest, it looks like overkill anyway. All I want to do is send basic information:
Merchant's e-mail (to which payment will be sent)
Item cost
Item quantity
Logging into my own PayPal account and generating a button using their form will not work for this. I am trying to generate a button dynamically, based on the information the user enters into the plug-in. I would also prefer the method to be more secure than using the HTML hidden input fields.
If there is absolutely no easy way to send PayPal these three simple things, then I would greatly appreciate seeing a more thorough explanation of the SDK. I do not know what composer is, nor what bootstrap.php is supposed to be, nor do I know where to save the files that use the SDK's functionality. Once those questions are answered, I only want to know how to send those three things and the bare necessities. I don't need all this extra information.
Best way to do it is to generate direct URL, something like: (you can click it)
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yourpaypalbusiness#hotmail.com&notify_url=http://example.com/ipn.php&item_name=myitem&item_number=1&currency_code=USD&rm=2&amount=49.99&quantity=1
This way you can populate URL query parameters from your database/plugin.
I hope so it helped.

How to use Reddit's POST api?

I have managed to grab data from Reddit easily, displaying all links that users have submitted to a sub-reddit. What I want to achieve now though is to allow users of my site to login to reddit, and post to that sub-reddit from my site.
How would I achieve this using PHP?
I have searched the web everywhere and cannot seem to find anything that can help me. I am a begginer a PHP so it's quite confusing at times.
If there is an article explaining exactly what I want, I would be grateful if you could link me to it :)
Thank you!
EDIT: Documentation here; http://www.reddit.com/dev/api
I'd recomment to use/look into this opensource project on github (not my project). It uses curl to communicate and it might even be enough for you.
Another option would be to look into httpRequest::send and simply send your post variables with this method. This is if you like things to be more lowlevel.
The reddit api basically tells you what post parameters you need for which action

Searching twitters public timeline using JQuery

So a while back I used to use the twitter json search in one of my apps but it seems since the change in API versions there has been some major changes which even after reading the documentation I still can't get my head around and it really doesn't make it very easy to understand so hopefully one of you tech guys out there can help me out.
I want to clean my application up so it works again in plainly doing the following:-
http://search.twitter.com/search.json?
q='+param+'&
rpp=100&
result_type=recent&
lang=en
Obviously with the changes this is no longer possible but I want to be able to do this again using the new address but in JQuery unless someone can suggest either a tutorial or a piece of code or even a link to a topic where I could get my answer. I'm also open to using PHP as this is what I used at one point with searching Facebook's timeline and you can get an access token using $.get() for Facebook so surely it would be the same with Twitter too?
Any advice/code is welcome.
Thanks!
the search API needs authorization now. I'd say that, first off, you need to call the https url not http.
With Abhramam William's library you'd do something like the following, after having received your app's bearer token:
$your_tweets = $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=from:grey_mina&result_type=recent&count=5");

Upload Post to Facebook Automatically in PHP

I've made my own "blog-style" site, without using WordPress or anything of the sort. I'm looking for a way to automatically post a certain portion of the article to the Facebook Wall of the Facebook Page I run for the website. Is there an easy way to do this? I'm using PHP for post submission.
This is possible using the Facebook API. You can probably find PHP libraries that cover much of the functionality but it would still be a good idea to get your head around the Facebook API so that you understand how things work. See http://developers.facebook.com/docs/reference/api/

Categories