Interested in Grabbing XBOX Friend's List - php

I would like to get the list of XBOX friends for a certain gamercard (http://live.xbox.com/en-US/profile/Friends.aspx) and display it in a widget for my site.
I know that there are alot of iPhone apps that do just that, but I would like to do it on the web, without an iPhone.
Does anyone know of a PHP class to either login via cURL to live.com so that I can scrape the details or if there is a RSS feed somewhere that I can use.
Any help would be greatly appreciated!
Thank you

Microsoft frowns on screen scraping of the Xbox.com website. If you screen scrape a lot of data, you're likely to get your IP(s) blocked (though, I don't know that it's expressly forbidden by the terms of service or how actively they block IP addresses; it's just that they could).
There is a community XML API for most of the Xbox.com gamer data, but it is not available to the general public. In order to access the API, you need to become a member of the Xbox Community Developer Program (XCDP). Membership is free, but I don't know that the program is accepting new members right now, and I don't know that there is a public website for the program.

As far as I know there is no open API nor you can scrap the data easily as logging in into live is real beach - it does some data manipulations with javascript before submitting the form. So if you want to login you need to either crack that js algorithm or run your own js engine, none of which is easy. I tried doing that some time ago and gave up.

Related

Access Shares from a Company on LinkedIn via PHP from Wordpress

I am trying to retrieve the shares of a company on linkedIn (basically just read the stream, as is easily possible on twitter) to display them on a Wordpress website in a custom HTML/CSS styling, so I only need the data. This should happen just in the backend, so no user interaction (as login etc.) should be necessary.[The end result is simply a slider that aggregates the latest social media posts, like twitter, facebook & linkedin. Works for Twitter & FB so far.]
After many hours of research it seems to me that this is not directly possible with an entirely server-side solution?
Can someone direct me if it is possible to do so? There are many php linkedin libs, but all of them seem to direct to some sort of login from which the user is redirected back? (maybe I am mistaken here).
Any help is greatly appreciated!
Take a look if they offer public rss feeds, thats the most simple way. When they offer only protected then search for developer acces from where you can get api access.

What does Facebook use for this feature?

I am not sure this is correct SO to post on, but if not admin please feel free to move it to relevant SO or suggest me to move it.
I am using a contractor to help me create a website for some project. He has coded the entire custom website in PHP.
One feature that I requested was that links posted on the website should have the preview feature that we see in Facebook (FB) like in attached picture.
But he keeps saying that I can only use embedded code to create such preview feature. When I show him the FB preview he says FB is probably using technology of its own. Currently if I post the link from youtube to my test website it shows up as text like: https://www.youtube.com/watch?v=jtkUtNzaFPI&t=1909s
My question is:
What exactly is FB using? Is this easy to implement for any PHP developer or is it really time consuming implementation.
"he says FB is probably using technology of its own"
His answer to your question is utter nonsense, and indicates only that he doesn't want to do what you're asking. You hopefully aren't paying him very much.
What Facebook is doing is kind of sneaky, but structurally simple. The order of operations is:
User enters text on Facebook page.
AJAX request is sent to Facebook server with text.
Facebook server parses and sees that there's a link in there.
Facebook server makes a server-side HTTP request to link destination to find out more.
Facebook server parses response for anything it can add to the input template that the user is seeing.
Facebook responds back to user (maybe web sockets? maybe a response to that earlier AJAX request?)
Client-side code on the Facebook page updates what the user is seeing.
Steps 2-6 intuitively sound like they may take a lot of network time, but these tend to be very quick services (Facebook itself, YouTube, etc.) so that's usually not a problem.
The main concern here are Step 3 and Step 5. That's where Facebook is using some custom logic that it likely spent considerable effort defining. There may be libraries which help with that, likely made in response to the demand for this exact feature. I don't have any to recommend, sorry.
The technical implementation is the easy part. Determining from the user's text what data to fetch could be difficult. Determining what data to put in the page could be difficult. That depends on the scope of what you want to implement.
For example, it may be difficult to detect if the user has entered a variety of things you can respond to, but it may be easy (with a regular expression perhaps) to detect if the user has entered what might be a YouTube URL. So if you reduce the problem space to just YouTube previews, then you may be onto something. If you can successfully parse that YouTube link, you're in business. Now you can hit a YouTube API and get information to send back to the page.
Continue with that pattern for other small problem spaces (previewing a link to an image, previewing a link for another popular site, etc.), and you can over time add that same feature.

How do 3rd Party Websites obtain in-game information /stats?

So I just finished making a sample model of Lol Name Checker within my local server. It checks the availability of a username for a game. Theres nothing mind blowing about it because all the information is available to the public on their website and even searching up their match history officially here. In a smart manner, the site compiles his own database based on the content he crawls through from other sites (I assume but this seems the case). What puzzles me is how other websites can obtain in-game data that is not available online (so they cant use php to crawl their web pages for text content). For example in this website. My question is how do they display data without having direct access to their sql database? Or is there an API I am missing for calling these functions that are available to developers (which I doubt)?

Custom display of posts of Facebook, Twitter, Linkedi and Google+ on your website

Is it possible to shows posts, feeds etc in a customized manner on your website? For example if I don't want to use the plugins they provide to embed on your website which show posts in a rectangular box I want to show posts from these social media sites in different manner. For reference please visit this website and scroll down to section below Latest News and Testimonials you will find Facebook, Twitter, LinkedIn and Google+ with Lorem Ipsum text. It seems like this website has also not implemented this feature (don't know if its possible with all social sites) but I am asking if you need to implement something like this is this possible? I have to implement it on a PHP website, if that helps. Thanks for your help in advance.
Although you're asking for something different than embedding, I still believe what you're looking for is "Embedding posts". Most social sites do not want you to rebuild their stream experience and put it somewhere else -- additionally, most content policies on these sites prohibits you from caching or storing posts because it can easily become a privacy issue. Finally, if you're pulling a lot of posts, frequently, from these services, you will encounter API call limits.
The following resources should get you started with properly embedding posts so you don't have to worry about how you're caching:
Google+
Facebook
Twitter
If you (really, really) wanted to build out your own solution you should do it client-side in JavaScript, not in PHP. For this, you would need to use the following APIs:
Google+ uses the Activity API
Facebook has the Graph/Feed API
Twitter has the Search/Get Tweets API pass from%3A[username] to get specific user Tweets
If you were to try doing this in PHP, it would be easier using client libraries and starting from sample code.
Google+ PHP example
Facebook PHP client library
Twitter PHP client libraries
Make sure that you're following the content policies of the various sites you're aggregating. In other words, if you're doing something like caching the results in a MySQL database pulled using your PHP script, invalidate the cache every 3600 seconds and every time a post is no longer retrieved from your API calls.

What is the best solution to show different styles depending on the weather in the users location?

I am developing a website and Facebook application for a friend who runs a gardening services and does some handy-man servicing and would like some help to do the following;
I would not only like to do this on my Facebook application which is fairly similar to the website itself just a little more integration with Facebook, posting to wall and whatnot, but on the main website too. The reason why I have mentioned this is, as you may or may not know, one way of having an application on Facebook is to tell Facebook where the directory is and whatever on that directory on wards is shown in an iframe.
With Facebook going to my chosen directory and showing this on Facebook via an iframe, well, I don't exactly know what goes on, if they're on my website as well as Facebook or whatnot and due to being fairly new to the likes of PHP, I do apologize if this question seems a little messy but I do hope I do explain myself.
I've been told that the best option is to use HTML5 Geolocation as my primary method with a fallback to a better IP geolocator is my best option to find out their location, then I would like to check their current weather via the Met Office website ( http://www.metoffice.gov.uk/datapoint/product/uk-3hourly-site-specific-forecast/detailed-documentation ) to then know what stylesheet should be used.
Different stylesheets are being developed for most conditions such as; Showers, Heavy Rain, Overcast, Sunny, Snow and so on until they are all developed to customize the experience for the user and to also show different div's depending on their weather and show them their forecast. An example of a div could be; if it's snowing, it would ask them if they would want any snow to be ploughed.
Lastly, something I should have also asked and mentioned earlier, I would also like this feature to work for UK users to avoid any confusion and if it is possible to see how far the user is from where they are based as he has only told me he'll do up to a 100 mile radius and if it helps him pay for his bills and whatnot he'll go there, but is there a way to check how far away they are for a contact form or to show on screen or whatnot.
Summary:
Show different graphics depending on their location's weather and to see how far they are away from the base and show their weather forecast and if possible to change the weather upon the 3 hourly update.
Inform non-UK users that this is a UK only business and it would cost too much to go there.
Best Regards,
Tim
You can achieve by using the IP address of your visitor, then tracing down the location of the user. After the location is found out, use any weather report server like Google to get the weather of that location. Using the value returned by the provider, you can use the server side script to change the layout or contents of the page.
It can be a hassle, and might reduce the page load time due to extended time taken to contact and wait for response from the weather report provider.
PS: Suggestions and improvements expected.

Categories