Rails parameters error - Implementing Google Maps API - ruby-on-rails

I'm currently building an Events app using Rails.I'm implementing the Google Maps Embed API for the Events show page and getting the following error -
"The Google Maps API server rejected your request. Invalid request. Missing the 'q' parameter."
I have the Geocoder gem installed, included latitude & longitude. For my address I'm using a 'location' column and use jquery.autocomplete for that purpose. This is my code for the showpage -
<h3>Location</h3>
<p><%= #event.location %></p>
<iframe
width="600"
height="450"
frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?key=<%= ENV["google_maps_api_key"] %>=<%= #event.location %>" allowfullscreen>
</iframe>
Do I still need a specific method for the address in my events model to fix this? If so, how do I express that in order for this to work?

There's a small error in your google maps URI (as per the error message), try this as the src attribute:
src="https://www.google.com/maps/embed/v1/place?key=<%= ENV["google_maps_api_key"] %>&q=<%= #event.location %>" allowfullscreen>

Related

Microsoft Graph API Subscriptions endpoint provides #odata.nextLink that gives a 404

I'm currently experiencing an issue with the subscriptions endpoint.
When making a call to https://graph.microsoft.com/v1.0/subscriptions, a next link is returned.
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"#odata.nextLink": "https://graph.microsoft.com/v1.0/subscriptions?$skiptoken=NPt3S7g2KIxJBA0KWwQetRhFtPT2ht6ZVYoisBCCtvlN2050CZg8WeNGnmaMqUn.....",
"value": [
...
...
When following this next link, most of the time, more results and another nextLink should be provided until all the data has been returned.
However for the last two days we have been experiencing issues where following this link has led to the final link giving a 404 response and some html with the following body.
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>404 - File or directory not found.</h2>
<h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
</fieldset></div>
</div>
</body>
Is this a known issue with the service, or is there a process that should be being followed differently here?
I have been able to replicate this in Postman as well as impacting the java sdk here.
Thank you for your help.
As of 2021-10-13, this issue is no longer occurring and the Graph API is once again functioning as expected.

Embed Twitter Percent-encoding

I was trying to copy the same method to my website by using the below code, but when I implement other twitter user or account, it is not working. Can anyone check if the code format is still working in other Twiiter account?
<iframe border=0 frameborder=0 height=250 width=550 src="https://twitframe.com/show?url=https%3A%2F%2Ftwitter.com%2Fjack%2Fstatus%2F20"></iframe>
I created a JSFiddle and looks like the code is working fine! Tested with two other users and both are loading fine. You have to check if your URL is properly encoded and if you have any adblockers that blocks social media features.
Link: https://jsfiddle.net/ftcz6pdu/4/
Sample code:
<iframe border=0 frameborder=0 height=250 width=550 src="https://twitframe.com/show?url=https%3A%2F%2Ftwitter.com%2FItsSkyLOL%2Fstatus%2F1011166507257270273"></iframe>
<iframe border=0 frameborder=0 height=250 width=550 src="https://twitframe.com/show?url=https%3A%2F%2Ftwitter.com%2FPoppyHarlowCNN%2Fstatus%2F1010899818955333632"></iframe>
The online URL encoder that I used: https://meyerweb.com/eric/tools/dencoder/

IFrame Like Button gives Suspicious URL error

I created a Google Sites site and added a Like button using the IFrame option.
The button looks fine but when a user clicks Like, they receive the following error:
"Sorry, this post contains a suspicious URL: Unknown error".
It looks like a Facebook like issue, since the error message is displayed in a Facebook branded pop-up window.
My site: https://sites.google.com/site/wheresthezbfairlane/
How do I fix this ?
Help!
Thanks
Nick
If you copy pasted the code from the facebook plugin site you might have to remove the 'amp;'s that separate the query strings right after the href attribute.
<iframe src="//www.facebook.com/plugins/like.php?
href=http%3A%2F%2Fwww.facebook.com&width=450&height=80&colorscheme=light&layout=standard&action=like&show_faces=true&send=true"
scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
So, in the code above just replace '& amp;' with '&'

like button suspicious url error

I created a website on google sites, using my own domain name. Clicking the like button (steegle.com generated) gives the error: "Sorry, this post contains a suspicious URL: Unknown error". Any ideas on how to fix this or better code to use?
This is the code generated/used:
<img src="https://www.google.com/chart?chc=sites&cht=d&chdp=sites&chl=%5B%5BGoogle+Gadget'%3D20'f%5Cv'a%5C%3D0'10'%3D199'0'dim'%5Cbox1'b%5CF6F6F6'fC%5CF6F6F6'eC%5C0'sk'%5C%5B%22Steeglecom+-+Google+Sites+Like+Button%22'%5D'a%5CV%5C%3D12'f%5C%5DV%5Cta%5C%3D10'%3D0'%3D200'%3D32'dim'%5C%3D10'%3D10'%3D200'%3D32'vdim'%5Cbox1'b%5Cva%5CF6F6F6'fC%5CC8C8C8'eC%5C'a%5C%5Do%5CLauto'f%5C&sig=adcK6vIIXtgjrIIlMyRBX2yiuVI" data-igsrc="http://86.gmodules.com/ig/ifr?mid=86&synd=trogedit&url=http%3A%2F%2Fhosting.gmodules.com%2Fig%2Fgadgets%2Ffile%2F110509162544058635853%2Fsteegle-google-sites-facebook-like-button.xml&up_url=www.freeeducationleague.org&up_layout=standard&up_width=&up_showfaces=false&up_action=like&up_font=arial&up_colorscheme=light&h=35&w=200" data-type="ggs-gadget" data-props="screenshot:http#58//www.steegle.com/images/facebook-like-120x60.png;url:http#58//hosting.gmodules.com/ig/gadgets/file/110509162544058635853/steegle-google-sites-facebook-like-button.xml;params:up_url=www.freeeducationleague.org&up_layout=standard&up_width=&up_showfaces=false&up_action=like&up_font=arial&up_colorscheme=light;align:;borderTitle:Steegle.com - Google Sites Like Button;height:35;igsrc:http#58//95.gmodules.com/ig/ifr?mid=95&synd=trogedit&url=http%3A%2F%2Fhosting.gmodules.com%2Fig%2Fgadgets%2Ffile%2F110509162544058635853%2Fsteegle-google-sites-facebook-like-button.xml&up_url=www.freeeducationleague.org;mid:95;scrolling:no;showBorder:false;showBorderTitle:null;spec:http#58//hosting.gmodules.com/ig/gadgets/file/110509162544058635853/steegle-google-sites-facebook-like-button.xml;up_url:www.freeeducationleague.org;width:200;wrap:true;title:Steegle.com - Google Sites Like Button" width="200" height="35" style="display:inline;float:right;margin:5px 0 5px 20px;" class="igm">

Twitter Timeline through Expression Engine

Can anyone help me integrate Twitter through Expression Engine. I am new to expression engine and I have tried to follow the example the Twitter Timeline developed by the EE team but couldn't get it working.
Can anyone help me with step by step process in EE2?
Thanks
Using the example from the Twitter Timeline Plugin download page, insert the following code into one of your ExpressionEngine templates:
{exp:twitter_timeline screen_name="ladygaga" limit="3"}
<div class="tweet">
<div class="date">{created_at format="%m-%d %g:%i"}</div>
<div class="author">
<div class="icon">
<img src="{profile_image_url}" width="48" height="48" alt="" />
</div>
{name}
</div>
<div class="status">{text}</div>
</div>
{/exp:twitter_timeline}
Note: The plugin only works on public Twitter feeds, so make sure that the feed your trying to display is not private. For this example, I'm using Lady Gaga's twitter stream.
All error messages are logged in the Template Parsing Log.
Therefore if you have no output, or unexpected output, enable the Template Parsing Log in the Control Panel's Output and Debugging Preferences at: CP Home > Admin > System Administration > Output and Debugging.
Reload the page in your browser and look through the Template Parsing Log for information from the Twitter Timeline:
If you still can't get the Twitter Timeline plugin to work, post a description of your problem to the ExpressionEngine 2 Technical Support Forum — they'll be able to better help troubleshoot your issue.

Resources