ginader / easychirp

easychirp.com - Web accessibility for the Twitter website application
11 stars 1 forks source link

Functionality for shorten URL (server-side) #62

Closed weboverhauls closed 11 years ago

weboverhauls commented 11 years ago

When complete, need to ask Jared to update http://weba.im/ with URL format to send shorten link from that app to EC2.

andrewwoods commented 11 years ago

tried to get an app key from webaim, but jared said you already one. yet i cant find it. do you know?

weboverhauls commented 11 years ago

The key is "a11y". From EC1:

$req = "http://weba.im/api.php?action=shorturl&url=".urlencode($_GET["url"])."&format=json&key=a11y";
weboverhauls commented 11 years ago

Andrew, I see you've done a lot of work on this. What's the status?

andrewwoods commented 11 years ago

It works for webaim - shortening and expanding. The URL you'll use is http://easychirp.local/url_shorten/webaim You'll set 2 params via POST - url and ajax. http://easychirp.local/url_expand/webaim works the same but uses a shortened URL as the url parameter

weboverhauls commented 11 years ago

I was hoping you'd finish the server-side trip by now. Shouldn't the service be a post parameter (like the form)? How is a URL submitted to bitly?

We need to finish this ASAP.

andrewwoods commented 11 years ago

I'll be working on this today. Shouldn't take too long

andrewwoods commented 11 years ago

This is done - ready for testing.

weboverhauls commented 11 years ago

Sorry man, I have 2 problems.

  1. Need to make the shortener service a post param so user can choose btwn webaim and bitly. I started but had error. I think I'm breaking the url_shortener service. Ideas?
    public function url_shorten()
    {
        $type = $this->input->post('urlService');

        $this->load->library('url_shortener');
  1. Bitly wasn't working for me which is why I did webaim first. I entered my password in url_shortener but didn't work. Then I registered another and didn't work. I looked in original Easy Chirp, and the params were different; was only using username and key to authenticate. Did you test this locally?
andrewwoods commented 11 years ago
  1. that solution looks fine, but you'll need to update the routes from url_shorten/(:any) to url_shorten
  2. I did test locally. For bitly, i didn't have the accessibletwitter password (the one you use to login to bitly) so i used my personal account details. Before committing i changed the credentials back to accessibletwitter. so you'll need specify the correct values. the values needed to be hard coded into the Bitly class. The bitly api has changed since you developed the original easychirp - particularly the authentication.
weboverhauls commented 11 years ago

I created a bitly account and added my credentials. Still doesn't work. I don't get it. Can you please give it a spin? I couldn't find a client_secret but an api key. Feel free to user my user/pw to log in on browser if you need to. [5ecdb62]

andrewwoods commented 11 years ago

It's frustrating that Bitly was working yesterday but not today with the same code. I'm actively working on this.

weboverhauls commented 11 years ago

Sweet!!!