Spotify API with basic core PHP - php

I just need to show my own music on my website. So mine is not an "app" which other users will use. I simply want a PHP script that queries Spotify from time to time, perhaps once every day, and finds if there's a new song added to my playlist. If so, it adds that to my website and shows it on my site.
For this I'd like a very simple script that allows me to authenticate myself in a server side code (which will be executed via cron) and bring back all the tracks in a specific playlist. I'd prefer not to use any library etc, just plain PHP code.
But I'm not sure which 'Authorization API' here I should use. Curl is just for testing, yes? Not for actual code especially with GET as that would be insecure? Would appreciate any pointer to any code sample for this. Thank you.

Related

How to extract data from facebook api or using php sdk for Job applications?

I did lots of research to find the proper guideline to get a few thing done but seems like really hard. All I am asking is below:
Anyone know in php how to extract posted jobs?
How to get job applications like all the users applied for job?
Where to start my code in php?
I know all below:
business manager id
app id
app secret key from my created app.
but I don't know how to get the pageID?
I have also found this URL to get the job applications: job applpications
but don't know how to perform from the above URL.
Please give me some guideline here as I am completely new to the Facebook API. Also, please if someone can provide me some starting point of php code to begin with my 1st and 2nd question.
Also if you check below image then it's showing that you can get applications from job:
There is no publicly available Jobs API. Reading job posts via the /feed endpoint is also not supported.

How to fetch data from external site to own site

I want to fetch data from live stock market to my web site. By using php and jQuery.
Has the source got an API you can work with to fetch the data? If so read their docs and implement it.
If not you could possibly do a Curl request and parse the data you need if your allowed.
More importantly you need to be more specific with your question if you want to get good answers, if any at all :-).
You need to find a web service that offers a stock market feed in the form of JSON or XML, so that your computer would be able to parse it. Not a website. Most of those feeds are paid - especially those that are close to real-time.
Then, once you have such a feed, you should be able to access it via your browser - just by typing in the URL. For example, http://www.quotewebsite.com/symbol=MSFT
This will help you understand what your server side script is supposed to do. Then, in your PHP script (PHP is a server-side programming language), issue a CURL request to download that specific page into your website's database (ex. MySQL). This will allow you to have historical data inside your own system. Then you get to render that data back to your own customers by querying your own database.

How do I programatically search Google Plus for posts via the PHP library

I'm trying to get my head around how to use Google's PHP library to search Google Plus using the API. I want to create a command line script that can be run regularly (cron job) to search Google Plus for a key word and then store the results in a database. I will then have a website (moderation tool) that pulls the posts from the DB and allows the moderator to reply to the original poster (or not and delete's that post from the DB).
I can do this with curl on the public API but it feels dirty. I want to use their API properly with OAuth2 but that involves a website for authentication. I want to run it via a cron job php script at the command line.
Can this be done?
Keep in mind that, although you can use OAuth2 to authenticate against the Google+ API, you don't really get anything from doing so. The only thing you can get right now are public posts.
So what you're doing is fine. If you still want to use PHP for some reason, you can take a look at https://developers.google.com/+/api/latest/activities/search#examples and select "PHP" in the pull down to see some example PHP code. If you're having trouble with this, post a question with details about what you've tried and what problems you're having with it.

How to Build a realtime multiplayer game using action script (flash) and php backend

I wanted to build a real time multi player game using flash (action script 3) as front end and use php as back end language and mysql database. There are lot of posts and tutorials online, but nowhere I found an article which would suffice my requirement.
I thought of using smartfox server. But lately they are not supporting php backend technology. Here is the answer by their technical person.
http://www.smartfoxserver.com/forums/viewtopic.php?f=18&t=15791
This seemed to be a useful post, but it didn't give me complete information as to handle the game play with php back end.
http://gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking/
Do we have to use web sockets in front end. And how to handle the user's delay on the website. Also I am supposed to use Facebook Login to get more users on the game.
My game should have multiplayer feature just like this one on facebook.
https://apps.facebook.com/livepool/
Can someone suggest me on this please.

Facebook Application and posting to a Page Stream

As usual, I'm having problems due to a lack of clear guide in the Facebook API Documentation.
Basically I have created an application that is installed to Facebook Pages, I want to periodically post automatically via my server to the Stream of these pages (of course, willing to have it authorised, etc), but I am just unable to find how to do this. I've looked at stream write, etc, but not sure how to best make use of this. I've looked at Extended Permissions, should this simply just work for Pages? I'm experimenting but not having too much luck at the moment.
Any ideas guys? Also, am I able to make use of the new "targetting" of users that Page administrators have when posting to a Page now?
Sorted out my previous problem, simply now wondering whether I can location target posts as Page admins are now allowed to do.
I am using PHP with the latest library updates btw.
Big thanks!
The way to post feed stories/streams is to use stream.publish function, check it out here:
http://wiki.developers.facebook.com/index.php/Stream.publish
And for automated publishing, you need to use cron job, here is how to get started with that:
http://www.aota.net/Script_Installation_Tips/cronhelp.php3

Categories