http requests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

http requests

Joe Guerra
Hmm, which gem would allow you to perform http requests within Rails?  I would like to send a request to the canadapost website and pass it some parameters and return a shipping total.

I do believe there is a canadapost gem, but I'm not sure how upto date it is.

I guess the other option is to like add paramters to a url and open that page on a new tab?

Thanks,
Joe

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/242b9e4c-637e-40ca-9021-a831325494b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Hassan Schroeder-2
On Wed, May 31, 2017 at 10:27 AM, Joe Guerra <[hidden email]> wrote:
> Hmm, which gem would allow you to perform http requests within Rails?  I
> would like to send a request to the canadapost website and pass it some
> parameters and return a shipping total.
>
> I do believe there is a canadapost gem, but I'm not sure how upto date it
> is.

Searching for `ruby gem canada post` turns up more than one -- why
don't you just try them and see which you prefer?

Similarly `ruby gem http` will show you some possibilities if you want
to roll your own solution. See also:
https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/index.html

HTH!
--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAujFWb8sdRi0tcPfrtwCW6NrkFZ6rKCKb20AteY1u_7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Joe Guerra
Ok, I'll try the gem.

How about passing the parameters in the url?  and opening up the canada post site with that?

Thanks,
Joe

On Wednesday, May 31, 2017 at 1:36:20 PM UTC-4, Hassan Schroeder wrote:
On Wed, May 31, 2017 at 10:27 AM, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="X9VWGRs0BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:
> Hmm, which gem would allow you to perform http requests within Rails?  I
> would like to send a request to the canadapost website and pass it some
> parameters and return a shipping total.
>
> I do believe there is a canadapost gem, but I'm not sure how upto date it
> is.

Searching for `ruby gem canada post` turns up more than one -- why
don't you just try them and see which you prefer?

Similarly `ruby gem http` will show you some possibilities if you want
to roll your own solution. See also:
<a href="https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/index.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fruby-doc.org%2Fstdlib-2.4.1%2Flibdoc%2Fnet%2Fhttp%2Frdoc%2Findex.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKU9D7YBeUN6JmA9Lp6rCrxuZLBA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fruby-doc.org%2Fstdlib-2.4.1%2Flibdoc%2Fnet%2Fhttp%2Frdoc%2Findex.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKU9D7YBeUN6JmA9Lp6rCrxuZLBA&#39;;return true;">https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/index.html

HTH!
--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="X9VWGRs0BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/80f27a88-f7ca-4bc8-a66c-380da41a4ccf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Hassan Schroeder-2
On Wed, May 31, 2017 at 10:39 AM, Joe Guerra <[hidden email]> wrote:

> How about passing the parameters in the url?  and opening up the canada post
> site with that?

You can certainly do that, if one of the gems doesn't meet your needs.

Have you read the Canada Post API docs?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAt-7xEk%2BhLtWLxMcmhyaknuzP9hrucUPCZz2K0%3DyB1JQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Jason Fleetwood-Boldt
In reply to this post by Joe Guerra
Hassan is correctly encouraging you towards the higher-level abstractions, like a Gem specifically written for this purpose.

If you really want to know how to make outgoing http requests, the answer is the Net::HTTP Ruby library, which is documented here:


But as Hassan said if there's a higher level abstraction, like a Gem, prefer that to writing your own low-level code.

But as a ruby developer the Net::HTTP Ruby library is at the very least something you should learn about and play around with, even if you don't actually need it for this immediate purpose.
-Jason



On May 31, 2017, at 1:39 PM, Joe Guerra <[hidden email]> wrote:

Ok, I'll try the gem.

How about passing the parameters in the url?  and opening up the canada post site with that?

Thanks,
Joe

On Wednesday, May 31, 2017 at 1:36:20 PM UTC-4, Hassan Schroeder wrote:
On Wed, May 31, 2017 at 10:27 AM, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="X9VWGRs0BQAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;" class="">JGu...@...> wrote:
> Hmm, which gem would allow you to perform http requests within Rails?  I
> would like to send a request to the canadapost website and pass it some
> parameters and return a shipping total.
>
> I do believe there is a canadapost gem, but I'm not sure how upto date it
> is.

Searching for `ruby gem canada post` turns up more than one -- why
don't you just try them and see which you prefer?

Similarly `ruby gem http` will show you some possibilities if you want
to roll your own solution. See also:
<a href="https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/index.html" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fruby-doc.org%2Fstdlib-2.4.1%2Flibdoc%2Fnet%2Fhttp%2Frdoc%2Findex.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKU9D7YBeUN6JmA9Lp6rCrxuZLBA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fruby-doc.org%2Fstdlib-2.4.1%2Flibdoc%2Fnet%2Fhttp%2Frdoc%2Findex.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFKU9D7YBeUN6JmA9Lp6rCrxuZLBA';return true;" class="">https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/index.html

HTH!
--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="X9VWGRs0BQAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;" class="">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/80f27a88-f7ca-4bc8-a66c-380da41a4ccf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

If you'd like to reply by encrypted email you can find my public key on jasonfleetwoodboldt.com (more about setting GPG: https://gpgtools.org

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/40BBA1BD-B10F-4D38-8C58-534574700D75%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

steve.enzer@gmail.com
In reply to this post by Joe Guerra
httparty might do the job

On Wednesday, May 31, 2017 at 10:27:42 AM UTC-7, Joe Guerra wrote:
Hmm, which gem would allow you to perform http requests within Rails?  I would like to send a request to the canadapost website and pass it some parameters and return a shipping total.

I do believe there is a canadapost gem, but I'm not sure how upto date it is.

I guess the other option is to like add paramters to a url and open that page on a new tab?

Thanks,
Joe

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e9754163-f5e9-4fe1-ada8-751cec092108%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Joe Guerra
Well, I got the canada post api keys.  

I've got to try it with one of following canada post gem...

https://rubygems.org/search?utf8=%E2%9C%93&query=canada+post



On Thursday, June 1, 2017 at 12:29:18 PM UTC-4, steve enzer wrote:
httparty might do the job

On Wednesday, May 31, 2017 at 10:27:42 AM UTC-7, Joe Guerra wrote:
Hmm, which gem would allow you to perform http requests within Rails?  I would like to send a request to the canadapost website and pass it some parameters and return a shipping total.

I do believe there is a canadapost gem, but I'm not sure how upto date it is.

I guess the other option is to like add paramters to a url and open that page on a new tab?

Thanks,
Joe

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9e59e1c7-9985-46ba-8bb3-b9e5dfc3c505%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Joe Guerra
Hmm, doesn't seem to work with the example they give.   

I've used my api keys, and popped in some values.  It's supposed to return a hash.  

I'm not sure if it's actually connecting?  How would I check to see if the request was actually sent?  and what the response is?

Thanks,
Joe

On Thursday, June 1, 2017 at 1:46:39 PM UTC-4, Joe Guerra wrote:
Well, I got the canada post api keys.  

I've got to try it with one of following canada post gem...

<a href="https://rubygems.org/search?utf8=%E2%9C%93&amp;query=canada+post" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Frubygems.org%2Fsearch%3Futf8%3D%25E2%259C%2593%26query%3Dcanada%2Bpost\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHLnLEwFmIyLywPCuxXLDuoYhoouw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Frubygems.org%2Fsearch%3Futf8%3D%25E2%259C%2593%26query%3Dcanada%2Bpost\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHLnLEwFmIyLywPCuxXLDuoYhoouw&#39;;return true;">https://rubygems.org/search?utf8=%E2%9C%93&query=canada+post



On Thursday, June 1, 2017 at 12:29:18 PM UTC-4, steve enzer wrote:
httparty might do the job

On Wednesday, May 31, 2017 at 10:27:42 AM UTC-7, Joe Guerra wrote:
Hmm, which gem would allow you to perform http requests within Rails?  I would like to send a request to the canadapost website and pass it some parameters and return a shipping total.

I do believe there is a canadapost gem, but I'm not sure how upto date it is.

I guess the other option is to like add paramters to a url and open that page on a new tab?

Thanks,
Joe

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eab4a103-d4fb-4ff8-806f-33aa3013739a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Joe Guerra
In reply to this post by steve.enzer@gmail.com
hmm, the canada post gem requires httparty as a runtime dependency.   Does it automatically get bundled with it, or do I need to bundle it myself?


On Thursday, June 1, 2017 at 12:29:18 PM UTC-4, steve enzer wrote:
httparty might do the job

On Wednesday, May 31, 2017 at 10:27:42 AM UTC-7, Joe Guerra wrote:
Hmm, which gem would allow you to perform http requests within Rails?  I would like to send a request to the canadapost website and pass it some parameters and return a shipping total.

I do believe there is a canadapost gem, but I'm not sure how upto date it is.

I guess the other option is to like add paramters to a url and open that page on a new tab?

Thanks,
Joe

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b97d3651-77b8-4995-b705-0b4c35db561c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Colin Law
On 2 June 2017 at 18:23, Joe Guerra <[hidden email]> wrote:
> hmm, the canada post gem requires httparty as a runtime dependency.   Does
> it automatically get bundled with it, or do I need to bundle it myself?

If it is properly defined then bundle install should install it.

Colin

>
>
> On Thursday, June 1, 2017 at 12:29:18 PM UTC-4, steve enzer wrote:
>>
>> httparty might do the job
>>
>> On Wednesday, May 31, 2017 at 10:27:42 AM UTC-7, Joe Guerra wrote:
>>>
>>> Hmm, which gem would allow you to perform http requests within Rails?  I
>>> would like to send a request to the canadapost website and pass it some
>>> parameters and return a shipping total.
>>>
>>> I do believe there is a canadapost gem, but I'm not sure how upto date it
>>> is.
>>>
>>> I guess the other option is to like add paramters to a url and open that
>>> page on a new tab?
>>>
>>> Thanks,
>>> Joe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/b97d3651-77b8-4995-b705-0b4c35db561c%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLut9eazFF%3DuVOwThdD8kwyYAVeusHuCMvrS41EQdmyQPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Joe Guerra
Yes, it installed it.  

But the gem is not very well documented.  I can't get it to work.


On Friday, June 2, 2017 at 5:07:10 PM UTC-4, Colin Law wrote:
On 2 June 2017 at 18:23, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gQXjlcXcBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:
> hmm, the canada post gem requires httparty as a runtime dependency.   Does
> it automatically get bundled with it, or do I need to bundle it myself?

If it is properly defined then bundle install should install it.

Colin

>
>
> On Thursday, June 1, 2017 at 12:29:18 PM UTC-4, steve enzer wrote:
>>
>> httparty might do the job
>>
>> On Wednesday, May 31, 2017 at 10:27:42 AM UTC-7, Joe Guerra wrote:
>>>
>>> Hmm, which gem would allow you to perform http requests within Rails?  I
>>> would like to send a request to the canadapost website and pass it some
>>> parameters and return a shipping total.
>>>
>>> I do believe there is a canadapost gem, but I'm not sure how upto date it
>>> is.
>>>
>>> I guess the other option is to like add paramters to a url and open that
>>> page on a new tab?
>>>
>>> Thanks,
>>> Joe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gQXjlcXcBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gQXjlcXcBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> <a href="https://groups.google.com/d/msgid/rubyonrails-talk/b97d3651-77b8-4995-b705-0b4c35db561c%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/b97d3651-77b8-4995-b705-0b4c35db561c%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/b97d3651-77b8-4995-b705-0b4c35db561c%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/b97d3651-77b8-4995-b705-0b4c35db561c%40googlegroups.com.
>
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8b0d0555-890c-48f9-b7fc-1f88eed1a5bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Hassan Schroeder-2
On Mon, Jun 5, 2017 at 12:08 PM, Joe Guerra <[hidden email]> wrote:
> Yes, it installed it.
>
> But the gem is not very well documented.  I can't get it to work.

That's a shame.

If only there were somewhere you could post your failing code and
get some other people to help...

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yD1Ho%3DAUbtmUBez9diEqFm5NycbdFPT2mjHXgFfUAtJQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Joe Guerra
Yes, I'm going to email the author of the gem.  Get his take on it. 
It hasn't been updated for over 2 years.  Maybe something has changed on the Canada post side.

On Monday, June 5, 2017 at 4:17:20 PM UTC-4, Hassan Schroeder wrote:
On Mon, Jun 5, 2017 at 12:08 PM, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="f_6fQsvFBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:
> Yes, it installed it.
>
> But the gem is not very well documented.  I can't get it to work.

That's a shame.

If only there were somewhere you could post your failing code and
get some other people to help...

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="f_6fQsvFBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9b4d65f6-8c56-46ba-b580-810780c53067%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Hassan Schroeder-2
On Tue, Jun 6, 2017 at 1:20 PM, Joe Guerra <[hidden email]> wrote:
> Yes, I'm going to email the author of the gem.  Get his take on it.

SMH. Apparently my attempt at sarcasm fell straight through...

>> > But the gem is not very well documented.  I can't get it to work.
>>
>> That's a shame.
>>
>> If only there were somewhere you could post your failing code and
>> get some other people to help...

TO BE BLUNT: If you want help, POST THE CODE AND ERROR,
or better yet, a standalone test case.

Saying "it doesn't work" doesn't help you understand the issue, or
allow anyone else to offer any useful advice. (The author of the gem
in question is probably not a mind-reader either.)

See also: http://www.catb.org/esr/faqs/smart-questions.html

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAU78QOU9s%3DO6xrsqRms7EWLw4vCcT_Lx-ZuDr8a50E3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Jason Fleetwood-Boldt
In reply to this post by Joe Guerra
Joe -


This (gems having gone stale) is generally par for the course in the Ruby world.

This is a good resource that gives you some idea of how popular & active any given gem might be:


Choosing an old gem that is stale (hasn't been updated in a couple of years) is common. Then again, the team I work with did an exhaustive internet search for some gem code that had to do with image optimization. They told me that one or more of the gems they were looking at hadn't been updated since 2015. We all laughed and thought to ourselves that meant it was a stale codebase.

Then upon more digging, we realized that the code from 2015 actually worked fine, and we just hadn't spent enough time trying to make it work for us. So in that case, it wasn't that no one had worked on image optimization since 2015, it was because that problem was solved in 2015 (in that example), and didn't need more work because it continued to work in 2017. 


As far as Canada Post, we use EasyPost for our shipping labels (https://www.easypost.com), which is NOT a gem, but in fact a SAS service. (It, incidentally, does have an open-source gem that has the API for communicating with EasyPost. But you pay them a small fee to generate each label).


Before you email the author of the gem, I'd like to take a small moment to expound on the nature of open-source software:

They said this back in the 90s, but it's so important and so relevant to you I'm gonna say it again:

"Free as in speech, not free as in beer."


"Free software" (what we called open source back in the 90s) isn't "free" like you don't have to pay for it. If that's what you think, you are totally wrong and need to adjust your mindset. It is "free as in speech" — can be copied, modified, etc, without limits imposed on it. 

So consider that someone — two years ago — wrote some code to interface with Canada Post. They put their code on Github. Putting OS code on Github has no guarantee that that author is going to continue to maintain it. 

And take a step back and think about this: Why would they? You have a need to have Ruby code that works with Canada Post. Maybe they do too, or maybe they have moved on an work somewhere else now, or maybe they won the lottery and retired, or maybe they got sick of being a Ruby developer and got a new profession. Or maybe (heavens to betsy!) they switched to Node.JS.

It's kind of like Ray Bradbury's great The Martian Chronicles: Someone was here once, they left some artifacts, you get to enjoy those artifacts, but you don't get to be them or live in their (ancient, bygone) society. (Ok so that Martian Chronicles analogy was a stretch. I'll work on it. But that is actually the core thesis of the Martian Chronicles — one of the best books of all time.)

My point is that unless you are offering to pay him or her, you need to think about the implicit need-dynamics of emailing him to "get his take on it." Obviously, there's nothing wrong with that on the face of it. But "free software" isn't "free" like you don't have to pay for it ("free as in beer"), it's "free" like the 1st amendment of the US Constitution (sorry Canadians!), there can be no laws recognized that limit it ("free speech").

This is a crucial and important concept to understand as you navigate the world of old gems that are no longer usable.

Oh and since you're new to the community: Check out that "Fork" button on Github! 

Fork the Gem, fix it, and submit your changes back to the original repository — you will then be contributing to the whole community. If you think the author is gone (like the martians in the Martian Chronicles), dead (that happens too— in fact I've corresponded with Github tech support over their policy regarding passed-away authors), or no longer cares, you can detach your fork from the origin repository and make a "V2" (or whatever) of the gem, upgraded with your fixes, rename it, and then you'll be the Gem's author. 

Then in 2 years from now when Canada Post changes their API again, some aspiring Ruby code will email YOU and say "why doesn't this gem work"! 
-Jason







On Jun 6, 2017, at 4:20 PM, Joe Guerra <[hidden email]> wrote:

Yes, I'm going to email the author of the gem.  Get his take on it. 
It hasn't been updated for over 2 years.  Maybe something has changed on the Canada post side.

If you'd like to reply by encrypted email you can find my public key on jasonfleetwoodboldt.com (more about setting GPG: https://gpgtools.org

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4E1024C7-D0A0-44ED-AF2B-E8106939C747%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http requests

Joe Guerra
Thanks.  If I can figure out to make my own http request to my canada post account, I can possibly grab the shipping rate if I pass it weight, length, height, and width.



On Tuesday, June 6, 2017 at 5:02:02 PM UTC-4, Jason FB wrote:
Joe -


This (gems having gone stale) is generally par for the course in the Ruby world.

This is a good resource that gives you some idea of how popular & active any given gem might be:

<a href="https://www.ruby-toolbox.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.ruby-toolbox.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEJBMkaac8-KiNf1DNGTLkui-ac4g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.ruby-toolbox.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEJBMkaac8-KiNf1DNGTLkui-ac4g&#39;;return true;">https://www.ruby-toolbox.com

Choosing an old gem that is stale (hasn't been updated in a couple of years) is common. Then again, the team I work with did an exhaustive internet search for some gem code that had to do with image optimization. They told me that one or more of the gems they were looking at hadn't been updated since 2015. We all laughed and thought to ourselves that meant it was a stale codebase.

Then upon more digging, we realized that the code from 2015 actually worked fine, and we just hadn't spent enough time trying to make it work for us. So in that case, it wasn't that no one had worked on image optimization since 2015, it was because that problem was solved in 2015 (in that example), and didn't need more work because it continued to work in 2017. 


As far as Canada Post, we use EasyPost for our shipping labels (<a href="https://www.easypost.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.easypost.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGdAxwuOfCfi5dJB_p5Vj4FtaVU3g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.easypost.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGdAxwuOfCfi5dJB_p5Vj4FtaVU3g&#39;;return true;">https://www.easypost.com), which is NOT a gem, but in fact a SAS service. (It, incidentally, does have an open-source gem that has the API for communicating with EasyPost. But you pay them a small fee to generate each label).


Before you email the author of the gem, I'd like to take a small moment to expound on the nature of open-source software:

They said this back in the 90s, but it's so important and so relevant to you I'm gonna say it again:

"Free as in speech, not free as in beer."


"Free software" (what we called open source back in the 90s) isn't "free" like you don't have to pay for it. If that's what you think, you are totally wrong and need to adjust your mindset. It is "free as in speech" — can be copied, modified, etc, without limits imposed on it. 

So consider that someone — two years ago — wrote some code to interface with Canada Post. They put their code on Github. Putting OS code on Github has no guarantee that that author is going to continue to maintain it. 

And take a step back and think about this: Why would they? You have a need to have Ruby code that works with Canada Post. Maybe they do too, or maybe they have moved on an work somewhere else now, or maybe they won the lottery and retired, or maybe they got sick of being a Ruby developer and got a new profession. Or maybe (heavens to betsy!) they switched to Node.JS.

It's kind of like Ray Bradbury's great The Martian Chronicles: Someone was here once, they left some artifacts, you get to enjoy those artifacts, but you don't get to be them or live in their (ancient, bygone) society. (Ok so that Martian Chronicles analogy was a stretch. I'll work on it. But that is actually the core thesis of the Martian Chronicles — one of the best books of all time.)

My point is that unless you are offering to pay him or her, you need to think about the implicit need-dynamics of emailing him to "get his take on it." Obviously, there's nothing wrong with that on the face of it. But "free software" isn't "free" like you don't have to pay for it ("free as in beer"), it's "free" like the 1st amendment of the US Constitution (sorry Canadians!), there can be no laws recognized that limit it ("free speech").

This is a crucial and important concept to understand as you navigate the world of old gems that are no longer usable.

Oh and since you're new to the community: Check out that "Fork" button on Github! 

Fork the Gem, fix it, and submit your changes back to the original repository — you will then be contributing to the whole community. If you think the author is gone (like the martians in the Martian Chronicles), dead (that happens too— in fact I've corresponded with Github tech support over their policy regarding passed-away authors), or no longer cares, you can detach your fork from the origin repository and make a "V2" (or whatever) of the gem, upgraded with your fixes, rename it, and then you'll be the Gem's author. 

Then in 2 years from now when Canada Post changes their API again, some aspiring Ruby code will email YOU and say "why doesn't this gem work"! 
-Jason







On Jun 6, 2017, at 4:20 PM, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XLbytc9XAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:

Yes, I'm going to email the author of the gem.  Get his take on it. 
It hasn't been updated for over 2 years.  Maybe something has changed on the Canada post side.

----

Jason Fleetwood-Boldt
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XLbytc9XAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">te...@...
<a href="http://www.jasonfleetwoodboldt.com/writing" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.jasonfleetwoodboldt.com%2Fwriting\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEDgYb2R9Pc71odefP_iaMJ_TLgaA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.jasonfleetwoodboldt.com%2Fwriting\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEDgYb2R9Pc71odefP_iaMJ_TLgaA&#39;;return true;">http://www.jasonfleetwoodboldt.com/writing

If you'd like to reply by encrypted email you can find my public key on <a href="http://jasonfleetwoodboldt.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjasonfleetwoodboldt.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGb1ZrXS-vy-0emKzzghQyxDWw2gw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjasonfleetwoodboldt.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGb1ZrXS-vy-0emKzzghQyxDWw2gw&#39;;return true;">jasonfleetwoodboldt.com (more about setting GPG: <a href="https://gpgtools.org" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgpgtools.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHndH9tmbP6n6vEQOQUZHmsUsYe9g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgpgtools.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHndH9tmbP6n6vEQOQUZHmsUsYe9g&#39;;return true;">https://gpgtools.org) 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f4803246-7324-4766-989e-2c975a4bda47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...