tiny URL api Automati in flex 3 - apache-flex

i am working in application of twitter in flex 3 and action script 3 , this in the text area when the user write my application automatically change http address to a short address but i don't know find the address within the text you can help me please..
thanks in advance

if you can use http webservices try to use one provided by bit.ly to shorten url
http://code.google.com/p/bitly-api/wiki/ApiDocumentation#/shorten
http://api.bit.ly/shorten?version=2.0.1&longUrl=' + textarea.text}" result="doSomething(event)"/>

I've never used this api, so research before use: http://userflex.wordpress.com/2008/05/29/tinyurl-flex-library/
It looks like a set of utility functions a simple as: TinyURL.create(url,callbackFunction);
Best of luck,
Jeremy

Related

Is there way to be absolutely sure that access came from QR code scan? [duplicate]

I have this project where I need to know if a visitor legitimately arrived from a QR code. Document.referrer value from a QR code shows blank. I have looked at some answers suggesting to put parameter in the query string (e.g. ?source=qr), but anyone could easily add the parameter into the URL and my code would believe it is from a QR code (e.g. www.project.com/check.page?source=qr) . I have thought of adding codes to make sure it is from a mobile phone / tablet as secondary way to authenticate but many browsers have add-ons to fool websites.
Any suggestions would be greatly appreciated.
Thanks in advance.
I think the best solution for you is creating your regional QR Codes pointing to:
Region 1) http://example.com/?qr=f61060194c9c6763bb63385782aa216f
Region 2) http://example.com/?qr=731417b947aa548528344fab8e0f29b6
Region 3) http://example.com/?qr=df189e7f7c8b89edd05ccc6aec36c36d
if the value of the parameter qr is anything other than f61060194c9c6763bb63385782aa216f, 731417b947aa548528344fab8e0f29b6 or df189e7f7c8b89edd05ccc6aec36c36d, then you can ignore it and assume the user didn't come from any QR Code.
Of course, any user can remove the source parameter. But at least he can't add a valid one, unless he really had access to the code.
...but anyone could easily add the parameter into the URL and my code would believe it is from a QR code
Well, anyone could also scan the QR code, view the link, and remove the source=qr from it.
Data collection is never 100% reliable. Users can change their browser's user agent, inject cookies with some strange values, open your page through a proxy server, and so on.
You could create your own device or App for scanning the QR-code. If you read the post I've linked, you will see that this is a waste of time and resources.
So, what is left is to make a solution which will work for most of the users. Appending a source=qr parameter to your URL seems to be the simplest solution. You could also link to an entirely different domain and redirect the request, so it would be more fraud-safe. But it will never be 100% accurate.

Calling an API from a wordpress page

Hello All: I am hoping someone can help me with this. I have never done a call to an API and am really out of my depth. What I am trying to do is a call to an API on a wordpress page. Here is what I have from the API:
http://zipcodedistanceapi.redline13.com/rest//distance.///
I have an API key. I have been trying to learn how to do this but there are thousands of ways and am really at a loss how to do this on a wordpress page. Can anyone help?
Thanks so much, Gerard
You can do it in php (here I use file_get_contents):
$distance = file_get_contents("http://zipcodedistanceapi.redline13.com/rest/<api_key>/distance.<format>/<zip_code1>/<zip_code2>/<units>");
Example taken from their site:
http://zipcodedistanceapi.redline13.com/rest/qVuOZidNAe5osYgYHbyK33EHpJD2nKjOFODE6QsH5y6yxnxfy5ZC9DjynXBLHUAm/distance.json/1000/2000/km
You can also use cURL or anything which can call an external page.
To decode json, have a look on json_decode.
Think about caching the values using your database or user cookies if possible to avoid multiple unnecessary requests.
EDIT: Based on the code provided in your comment (I took a fake API key from demonstration purposes):
$distance = file_get_contents("http://zipcodedistanceapi.redline13.com/rest/qVuOZidNAe5osYgYHbyK33EHpJD2nKjOFODE6QsH5y6yxnxfy5ZC9DjynXBLHUAm/distance.json/48433/485‌​01/miles");
print_r(json_decode($distance));

Passing Variables like facebook

i want to know how to send variables like Facebook.
ex: facebook.com/action-man.
here they will show actionman profile put i know how to send like this ex: facebook.com/users.aspx?user=actionman. so i want to know how to just send the username without the query parameter. thanks in advance
Use mvc routing engine. With MVC it is a must, so you should be already familiar with it.
If not, here you go:
http://www.asp.net/mvc/overview/controllers-and-routing

Translate Resource File

I'm developing a asp.net application and I use some components. I have a component with a resource file with a lot of keys in English. I need to translate it to Portuguese (Brazil, pt-br). I would like to know, if is there any way to translate it with a program? Or if is there a program that do this?
Thanks
I have the same issues and was looking to use Google's Translation APIs, based on this article Automatic Resource File Translation via Google Translate
I will let you know how it goes - but obviously you may still need someone to validate the output, I know I will.
Maybe my free Zeta Resource Editor is of some help for you.
I have not been satisfied with the various solutions out there so I wrote something: https://github.com/ekkis/Powershell/blob/master/MT.ps1

Google Friend Connect - Meaning of URLs

I would like to know the meaning of the URL's provided by google for its Friend Connect.
For example, in the FCAUTH, the user details can be grabbed by sending a request to the following link and a JSON encoded string will be returned
http://www.google.com/friendconnect/api/people/#viewer/#self?fcauth=
Also for getting user activites, I came across a link as below
http://www.google.com/friendconnect/api/activities/#owner/#friends/#app?fcauth=
What if I change the #owner to #me or #viewer , what would be the meaning and would it be valid?
Example, if i change it as
http://www.google.com/friendconnect/api/activities/#me/#friends/#app?fcauth=
http://www.google.com/friendconnect/api/activities/#viewer/#friends/#app?fcauth=
Also, could some one suggest me where can I get the User Profile URL for the user using the same method as above?
Thankx guys
Thankx guys but I found the answer by myself. I thought of posting it here so that it might help others.
Its available in brief in the Opensocial website
http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/restful-protocol
Hope it helps some

Resources