I was using this site via a PHP request from my own script to decode more than one ad.fly link at a time:
http://www.kassio.altervista.org/deadfly.php
But its been updated and won't handle direct PHP requests anymore. There seem to be a lot of sites out there that can decode ad.fly links. Does anyone know what the method is to do this. I'd quite like to include it in my own script rather than rely on a 3rd party to expand/decode the link?
TIA
The URL is likely a key in their database. Without their tools you cannot do it yourself.
This: http://pastebin.com/zFB6iUcq leads me to believe they have some API that you can access.
Related
I want to fetch the response from adobe analytics which I get in network panel of browser and display in it the page. This there any way to read the response through php. I don't have access to core files. i work as third party implementation team.
The short answer is you can't. php is server-side. Assuming you did the standard javascript Adobe Analytics implementation; well that's client-side. Your server can't see that stuff.
The longer answer is redeploying Adobe Analytics through a server-side implementation. Basically you setup the code but have it point to your server and then you forward it to adobe (proxying), and so now it is exposed to you server-side.
The alternative answer is depending on what it is you are actually trying to accomplish, you can make use of Adobe Analytics' s.registerPostTrackCallback function. Basically it lets you register a callback function to be called after every s.t or s.tl call, and it gives you the full/final request URL sent to the AA collection server. You can then make an AJAX request to pass it to your server and do whatever with it. Or since you mentioned displaying it on page, maybe consider using javascript to render it on the page? But if you're looking for actual response stuff (headers, content) well you're out of luck on this option.
The other other alternative answer is.. this almost sounds like you are looking to make some kind of browser plugin? If so, then on a plugin/extension level, the request/response stuff (including header stuff) is exposed on that level. But again, ultimately this is really a client-side solution..
But first step back and more clearly define what it is you are trying to do. Or if you've done that already, then try (more clearly) to convey that here.
I am trying to access JSON from this location which is not available to the public (unless you are within the company firewall),
http://12.34.56.789:8983/app/collection/select?q=*%3A*&wt=json&indent=true
My application is located on this web server,
http://www.mywebapp.com
I know that running an AJAX call to a different domain is out of the question, so I was wondering what techniques I could apply to get that data?
JSONP is not an option as I do not have control to attach a callback to the data that is located on that private server.
Thoughts?
use file_get_contents().It reads out the raw data, and returns that as string.
Write a proxy script and put it on your domain. All it has to do is to get the data an respond it to you. Your domain will be the same, Ajax will work and no-one can see, where you get the data from. - of course its slower than a direct request.
So to give an official answer to the comment, JSONP is the thing you are looking for, but it's not without it's downsides though. You can find a good, short tutorial on it here:
JSON versus JSONP Tutorial (sorry don't care to re-write it).
I need some references for cross domain php codes, as well as using javascript in the PHP. Reason why-
I am trying to create a PHP file that can be accessed from a certain site, I am making it so it test a key, as well as what website the user entered when signing up so that if someone tries to steal the script it will not work on their website.
I need to know how to do a cross domain PHP code, then I also don't want users see the Javascript I have written out, only a select bit. So basically it will be like this
$name_of_service({key:"H292H2723H20HC-0239C",options:"option"});
Can anyone explain to me my best bet on how to do this, as well as how to give a code to a user to get access to the PHP file such as...
$.get(php file);
or something of the sort. This is my first time dealing with all of this so I am a newb on the cross domain implementation. The first site does not allow for PHP Access we can only use it from another website server. Best explanations or best website explanation references please.
I appreciate anyones advice and tips. I don't need much more than just how to get it from end user to my server and hide my overall javascript from users, I mean I could encrypt it and then use a compiler though for those of whom know how to decrypt this isn't very helpful either. thank you.
For future reference:
Wikipedia already gives the answer here. You'll need to add a header Access-Control-Allow-Origin either in a .htaccess file or .php file assuming you are working in an Apache-based environment. Conveniently, PHP provides us the function header for this.
For your script to work with this, you'll also need jQuery to send the respective Origin header to the server. This can be done using jqXhr.setRequestHeader("Origin", location.href);
<script src="http://yourwebsite/file.php?key=blah&options=foo"></script>
I've run into a situation where one of my company's clients is building a website with our service, but would like to include on our site the podcasts that get posted into a table dynamically generated on a page of their main business site.
I've done a bit with ajax before, I know one of the biggest hurdles is using ajax to access content on a site hosted on a different server. From my research I gather that JSONP is the best solution in a situation like this, but for argument's sake let's say I know nothing of how their server is configured (and have no realistic way to find out) and that I don't know much about JSON (which is true).
I probably shouldn't hope for a silver bullet in a situation like this, but can someone point me at least in the right direction?
Thanks!
Create your own service with PHP that calls the AJAX service, that way you can call any remote service you want but the ajax call is to your domain. I can provide an example if you like.
You can use curl in situations like this.
If you can use jQuery, have a look at jQuery AJAX cross domain, otherwise, throw one of the following header functions into script that serves the request and see if this helps.
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Origin: http://permitted_domain.com');
This is something that the client browser supports, so your mileage may vary
for a non AJAX/Javascript solution, URL fetching mechanisms like file_get_conents() (note this configuration) or using cURL can be used to achieve similar (if not more inline) results
I am developing a script in php to manage my rapidshare accounts (for learning purposes), i wanted to know how can we login remotely and get accounts details on my site, something that api does, the details like traffic left, expiry date, etc.
Uncertain what exactly your question is, but it probably helps to take a look at the Rapidshare API. Additionally you probably want to make yourself familiar with the following functions/ components: fopen and curl to use the api/load the site. To get specific parameters out of the content I suggest using ereg or the xml functionality.
With PHP you could use either Curl, PHPSimpleHTMLDomParser, Snoopy, or phpQuery to grab the contents from the remote page. Be mindful that some websites require a user_agent, in which case you could setup one through ini_set prior to running your script.
You could use cURL to send HTTP requests from your script to the site. There are also ready-made solutions for PHP, such as Snoopy, which will let you do things like posting a form or scraping a page, without having to use cURL directly.
Since Rapidshare does not provide an API interface to their service, the only way is to use an HTML parser available for PHP, login with the script, and parse the values.
Update: Rapidshare does provide an API as merkuro has stated in his post.