Hello I have a strange problem(I am new in php and zend).
When trying to upload an image with twitter api, I am getting media_id like 5.5244895286041E+17.
Can somebody tell me why is this happening and how to fix it?
Thanks.
cast a (string) before setting the variable. The media_id most likely can't be represented as such a high floating number value. Consdiering its Twitter it mostlikely is a billion something.
Related
I am running this line of code:
location_list = self.service_mbbi_v1.accounts().locations().list(parent=account_name,readMask='name').execute()
And I get the list of the location IDs but I don't manage to get the Location display name, the display name, not just the ID. I wrote google and told them about my issue and they told me they are looking into it but it has been 2 weeks and no response yet. So just wanted o see if someone else had the same issue and if they fpund a solution or a workaround.
The documentation provides only an example, not a list of possible values:
https://developers.google.com/my-business/reference/businessinformation/rest/v1/accounts.locations/list
And even when I try the example value of the readMask flag I get an error:
[{'#type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'read_mask', 'description': 'Invalid field mask provided'}]}]">
I found this similar question:
Google Business Profile API readMask
The example they provide work for me but I still can't get the display name value.
I thought of using the google place ID I get from the metadata response and see if I can use another API to find the name but it feels they should be a proper 'readMask' string vale for the display name here and it is not 'displayName'..
Has anyone a hint of what can I do?
Thanks a lot
If you are trying to get the business name data, your readMask should be 'title'.
I tried to get youtube search from this link
https://www.googleapis.com/youtube/v3/search?part=snippet&key={my_api_key}&q=plane
it's work good. But i want to know how can i get result morethan 5 ?
ref : https://developers.google.com/youtube/v3/docs/search/list
Just in case anyone needs a solution for this.
You just need to add &maxResults=50 (to get a maximum of 50 results of course) at the end of the link / API call.
The person who asked the question was using &max-results... and not &maxResults... which is why it did not work.
The only thing you need to set here is maxResults. Now, if you're still getting 5, the problem maybe that there's really no other videos to list or your search filter is wrong.
The nextPageToken solution do not apply if you have maxResult set to 50 but are only getting 5. The problem could be your filter or the number of videos available.
I am developing an app for ios and I'm am using the Google places api. When I make my request, I am getting a response, status reads "Ok", but every attribute is null. Interesting thing is that for different searches, I get a unique number of results, and the same number of unique lat, lng attributes. Just everything else(name, formatted address,etc...) all return null. I've searched but can find no reason for this. Anybody else have experience with this issue or maybe an idea to correct it? Thanks!
I figured it out, in my url I was using "radarsearch", where i should have been using "nearbysearch". Thanks!
Hey guys this has been tripping me up quite a bit. So here is the general problem:
I am writing an application that requires users to enter their Summoner Names from league of legends. I do a pretty simple data scrape of a match and enter the data into my database. Unfortunately I am having some errors registering users with "special characters".
For this example I will use one problem user: RIÇK
As you can see RICK != RIÇK. So when I do the data scrub from the site I get the correct value which I push onto an array for later use.
Once I need the player names I pull from the array as follows: (player_names is the array)
#temp_player = User.find_by_username(player_names[i].to_s)
The problem is the users with any special characters are not being pulled. Should I not be using find_by? Is to_s changing my original values? I am really quite lost on what to do and would greatly appreciate any help / advice.
Thanks in advance,
Dan
I would like to thank Brian Kung for the link to the following: joelonsoftware.com/articles/Unicode.html It does a great job giving the bare minimum a programmer truly needs to understand.
For my particular issue I had used a HTML scraper to get the contents but which kept HTML entries throughout. When using these with my SQL lookups it was obvious that things were not being found. In order to fix this I used the HTMLEntities Gem to decode the text as follows (as soon as I put the into the array originally):
requires 'RubyGems' #without this cannot include htmlentries as a gem
requires 'HTMLEntries'
coder = HTMLEntries.new
line = '<'
player_names.push(coder.decode(line))
The Takeaway
When working with text and if running into errors I would strongly recommend tracing the strings you are working with to the origin and truly understanding what encoding is being used in each process. By doing this you can easily find where things are going wrong.
My version of Fogbugz is v8 and I'm trying to use the API to refine results by a custom field that i've created, so far i've got the following:
/api.asp?token=[token]&cmd=search&q=project:"=116"+plugin_customfields_at_fogcreek_com_environmentf52:LAMP&cols=sTitle,sPersonAssignedTo,ixBug,environment,product
But the API keeps giving me an error saying
The requested search axis 'plugin_customfields_at_fogcreek_com_environmentf52' is not recognized.
Does anybody know what I am doing wrong?
/api.asp?token=[token]&cmd=search&q=project:"=116"&plugin_customfields_at_fogcreek_com_environmentf52:LAMP&cols=sTitle,sPersonAssignedTo,ixBug,environment,product
You use & instead of + to indicate different search criteria.