Whois Parser error for ORG/NET URLs - ruby-on-rails

I have checking the whois information for .org/.net/.ae sites. While parsing it was giving error.
This is my code part:
record = Whois.whois(url)
date = record.created_on
Its giving the following error
Whois::ParserError: Unexpected token: Access to .ORG
What is the issue here. Its working for .com URLs.

The issue has been fixed in this pull-request and I've released a new version today. Make sure to use the v3.4.4.

Related

Syntax error at position 57 in 'TimeZoneStandard='microsoft.graph.timeZoneStandard'Iana'''

I'm trying to request the supported timezones in the IANA format for a user (in Java), and getting the following error:
Error code: RequestBroker--ParseUri
Error message: Syntax error at position 57 in 'TimeZoneStandard='microsoft.graph.timeZoneStandard'Iana'''.
GET https://graph.microsoft.com/v1.0/users/email#redacted.com/outlook/microsoft.graph.supportedTimeZones(TimeZoneStandard=microsoft.graph.timeZoneStandard'Iana')
SdkVersion : graph-java/v2.3.1
Authorization : [PII_REDACTED]
400 : Bad Request
[...]
Based on our test suit, the request was working fine 3 days ago, and started failing with that error yesterday. We haven't changed anything for a while on our implementation, so I'm a bit baffled. For the request I'm essentially doing the following:
final String url = requestBuilder.outlook()
.getRequestUrlWithAdditionalSegment("microsoft.graph.supportedTimeZones(TimeZoneStandard=microsoft.graph.timeZoneStandard'Iana')");
final OutlookUserSupportedTimeZonesCollectionRequestBuilder builder = new OutlookUserSupportedTimeZonesCollectionRequestBuilder(
url, requestBuilder.getClient(), null
);
IOutlookUserSupportedTimeZonesCollectionPage page = builder.buildRequest().get();
The reason I'm doing this instead of the standard:
final IOutlookUserSupportedTimeZonesCollectionPage page = requestBuilder.outlook()
.supportedTimeZones(TimeZoneStandard.IANA)
.buildRequest()
.get();
Is because this isn't working as expected, as described here: https://github.com/microsoftgraph/microsoft-graph-docs/issues/7594 (the issue is for C#, but happens in Java too).
What I notice is that the GET url looks fine, and works fine in the Graph Explorer using the /me endpoint instead of the /users endpoint. But the string in the error message looks modified:
'TimeZoneStandard='microsoft.graph.timeZoneStandard'Iana'''
If I'm not mistaken, the outer apostrophes are simply quoting done when printing the error message, but there are further apostrophes introduced after the = sign, which aren't present in the GET URI, which might be causing the syntax error. Still, I have no idea where those come from.
Any help or hint would be greatly appreciated!
I have modified the call something like this
https://graph.microsoft.com/v1.0/users/UPN/outlook/supportedTimeZones(TimeZoneStandard='Iana')
It worked for me.

What format of url is this with the colon almost in the end - https://speech.googleapis.com/v1p1beta1/speech:longrunningrecognize

I am trying to consume the google text to speech api here : https://cloud.google.com/speech-to-text/docs/async-recognize#speech-async-recognize-gcs-protocol
and it has this url format below
https://google-speech-api-base-urlspeech:longrunningrecognize
What is this URL format with colon(:)in the end?
When I try to hit this URL, it gives me an error specifically while running test case on it .e. Invalid URI. Invalid Port?
But the official google documentation says this is a valid url? How to use this?
This format of URL is called gRPC Transcoding syntax. Your first URL is invlaid , because it's in the first path segment of a relative-path reference.
https://google-speech-api-base-urlspeech:longrunningrecognize
This url is invalid for usage, whereas the one below, https://speech.googleapis.com/v1/speech:longrunningrecognize was running fine.
Try changing your URL to something like
https://google-speech-api-base-url/speech:longrunningrecognize. It will work.
I looked at the documentation page you referenced and was unable to see/find a URL that looked like:
https://google-speech-api-base-urlspeech:longrunningrecognize
However, what I did find was a URL of the form:
https://speech.googleapis.com/v1/speech:longrunningrecognize
which looks perfectly valid.
The documentation for this REST request can be found here:
https://cloud.google.com/speech-to-text/docs/reference/rest/v1/speech/longrunningrecognize
Could you have made an error in your reading and comprehension?
Apparently the colon (:) is legal in the path part of a URL:
Are colons allowed in URLs?

Yelp Place API returning "Invalid Signature" Error only from Nginx on EC2

Problem: I am getting an "Invalid Signature" error from Yelp API only from production (running on nginx server in AWS) When I run locally on my localhost:3000, there is no signature error, and everything works fine.
I am using the yelp gem in rails. Here's some code in ruby.:
$client = Yelp::Client.new({
consumer_key: $SL_CONSUMER_KEY,
consumer_secret: $SL_CONSUMER_SECRET,
token: $SL_TOKEN,
token_secret: $SL_TOKEN_SECRET
})
begin
$client.search("Los Angeles")
rescue => error
puts error.message
puts error.inspect
end
error.message prints out: "Signature was invalid"
error.inspect prints out: < Yelp::Error::InvalidSignature: Signature was invalid >
Everything works when I run locally on rails' Webrick server but when I run it in production, I get an "Invalid Signature" error.
Has anyone seen this? I've looked at some relevant posts, but this seems different. Thanks!
This will probably not pertain to most people, but the off chance it could help someone, here it is:
My "time" was effed up on my EC2 instance. So for example, in ruby, Time.now was not printing the actual time. (I think it was off by a few minutes or so).
Anyway, Yelp API requires a oauth_timestamp when you send a request. Of course, then, my request was timing out b/c the time was off.
How did I found this error out?
I just pinged the URL on my browser with the oauth, token, oauth_timestamp, etc. (few more) as query params. The browser spits out the error response in JSON, and it was saying that my request was timing out. When you use the ruby Yelp Client and catch the exception in code, it doesn't spit out the error response in terminal, so it's a bit more difficult to locate the exact root of the error.
How I solved it:
I re-calibrated the time in my ec2 instance by following the directions here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html
Problem is solved. Peace.
Invalid signature error in Yelp API occurs due to two reasons .
First , Either of your four keys i.e consumer_key , consumer_secret_key , Token & Token Secret is invalid . Secondly Parameters passed to Yelp API Function are either invalid or any of those are nil .

Jasper server integration in rails 2

I want to configure jasperserver-client gem in order to receive reports from Jasper server through SOAP.
The error I get is JasperServer::Error: JasperServer replied with an error: exception getting data strategy
after running the following from console:
client = JasperServer::Client.new("http://example.com/jasperserver-pro/services/repository", "jasperadmin", "jasperadmin")
request = JasperServer::ReportRequest.new("/public/test2", "PDF", { 'last_login_at' => '2013-01-15 00:00:00'})
pdf_data = client.request_report(request)
Any idea what might be the cause. I think that it's able to find the server and the report but it might be something wrong with the optional parameters.
I also tried generating the request without the option hash
I've solved my problem with this tutorial
http://jonif.blogspot.com.br/2012/07/

(#803) Some of the aliases you requested do not exist: access_token","type":"OAuthException"

I am trying to get access token using from facebook graph API in my rails 2.3 based web application. The request I am sending for that is :
https://graph.facebook.com/oauth/access_token?client_id=<client_id>
&redirect_uri=http://localhost:3001/facebook_callback
&client_secret=<client_secret>
&code=AQBgog2NvoUYQCXsa2bGpj--s9RD71F3zTKX344cUZ-
AWX4CNhdx3Yerl_wmzQkQ4zIUFVS_CRoN0zXaEW63dHcC9sH6_
vl7ljSxwA6TLSrkWVcfdfdrmwBTlMNIzyJr0h6irGW1LCdTw8
Racgd8MQ9RgVn1gFL26epWA
And it is redirecting me to
http://localhost/facebook_callback?code=AQBgog2NvoUYQCXsa2bGpj--
s9RD71F3zTKX344cUZ AWX4CNhdx3Yerl_wmzQkQ4zIUFVS_CRoN0mAB_Sr1H4K
dXIlzXaEW63dHcC9sH6_vl7ljSxwA6TLSrkWVcfdfdrmwBTlMNIzyJr0h6irG
SxsrRAXtdviNsBTMW1LCdTw8Racgd8MQ9RgVn1gFL26epWA
I am getting error in both development and production environment . I am not able to get the access token. Has anyone else face the problem ??
This looks correct - Facebook redirects to your redirect url with the code= parameter. You then need to exchange the code for an access token. See here: http://developers.facebook.com/docs/authentication/
edit: my bad, I misread the first section. You can sometimes have problems using localhost as a redirect. Are you using a live domain without port in your non-test environment?
Well, I found solution of my problem :
The problem was with the path which I was using for request of access_token . I placed a slash in front of the path and bingo. It worked like a charm.
So instead of
oauth/access_token?client_id=#{ #client_id }&redirect_uri=#{ #redirect_uri }&client_secret=#{ #client_secret }&code=#{ code }"
we just need to use
/oauth/access_token?client_id=#{ #client_id }&redirect_uri=#{ #redirect_uri }&client_secret=#{ #client_secret }&code=#{ code }".
Thanks to all people for your efforts.

Resources