I'm trying to do truck routing using the HERE calculateroute service. I need to calculate the estimated arrival time. From my understanding this should work if I simply add departure="2020-03-10T17:00:00+02" or "now" to the request. However, if I add this I get the same result as with a request that does not have a fixed departure time. I'd expect to see a departure- and arrival time in the response but they're not there.
curl -X GET 'https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=50.16193,8.53361&waypoint1=50.11208,8.68342&jsonAttributes=1&alternatives=1&routeattributes=waypoints,summary,summaryByCountry,shape,boundingBox,legs,notes,lines,routeId,groups,tickets,incidents,zones&legattributes=waypoint,maneuvers,links,length,travelTime,shape,indices,boundingBox,baseTime,trafficTime,summary&linkattributes=consumption,dynamicSpeedInfo,flags,functionalClass,indices,length,maneuver,nextLink,nextStopName,publicTransportLine,remainDistance,remainTime,roadName,roadNumber,shape,speedLimit,timeDependentRestriction,timezone,truckRestrictions&instructionformat=text&app_id={app_id}&app_code={app_code}&mode=fastest;truck;traffic:enabled&truckType=truck&trailersCount=0&axleCount=2&limitedWeight=20&height=4&width=2.5&length=10&truckRestrictionPenalty=strict&departure=now'
curl -X GET 'https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=50.16193,8.53361&waypoint1=50.11208,8.68342&jsonAttributes=1&alternatives=1&routeattributes=waypoints,summary,summaryByCountry,shape,boundingBox,legs,notes,lines,routeId,groups,tickets,incidents,zones&legattributes=waypoint,maneuvers,links,length,travelTime,shape,indices,boundingBox,baseTime,trafficTime,summary&linkattributes=consumption,dynamicSpeedInfo,flags,functionalClass,indices,length,maneuver,nextLink,nextStopName,publicTransportLine,remainDistance,remainTime,roadName,roadNumber,shape,speedLimit,timeDependentRestriction,timezone,truckRestrictions&instructionformat=text&app_id={app_id}&app_code={app_code}&mode=fastest;truck;traffic:enabled&truckType=truck&trailersCount=0&axleCount=2&limitedWeight=20&height=4&width=2.5&length=10&truckRestrictionPenalty=strict'
According to the documentation my request seems to be fine: https://developer.here.com/documentation/routing/dev_guide/topics/resource-calculate-route.html
I also found out that it works with the newer routing API v8 (8.20.3). But since there's no way to also get the link ids (I think?) I need to use v7.2.
Am I doing anything wrong?
By default if you don't put anything it's now. For example you can compare departure=now vs departure=2021-03-19T08:23:05Z then you will see the different between traffic time and maybe basetime as well.
I am working on a school project in R where I am attempting to map where the most popular youtube videos are posted around the world. I am able to get the data for the 50 most popular videos, but am having trouble understanding how to use pageToken.
The current get request I am using is with the following:
https://www.googleapis.com/youtube/v3/videospart=snippet%2CrecordingDetails&chart=mostPopular&maxResults=50&key={api_key}
Is it possible to retrieve more than 50 results using "pageToken" (I am unfamiliar with how this works).
Any help would be appreciated thanks!
Videos: list
pageToken string The pageToken parameter identifies a specific
page in the result set that should be returned. In an API response,
the nextPageToken and prevPageToken properties identify other pages
that could be retrieved.
Note: This parameter is supported for use in conjunction with the
myRating parameter, but it is not supported for use in conjunction
with the id parameter.
So when you get the results from the first request you should have an option called page token if you send that to the next request
&pageToken=api_pageToken
it should give you the next bunch of rows.
Note: I am not an R programmer so I cant help with the code for a loop over the results to find out if there are page tokens or not.
I am trying to get all the posts for a page by using
https://graph.facebook.com/PAGE_ID/feed
And it works like a charm. I can get all the info for each post except the like count.
The feed does return "likes" for each post, but it shows the like info for the first 25 likes. I cannot know the like count of a post.
The closest solution I found on the net is to set "summary=1" when requesting info of a post, e.g.
https://graph.facebook.com/POST_ID/likes?summary=1
This will return a summary field that shows the like count of this post, which is exactly what I need.
However, if this is the only way to solve the problem, I have to make additional network request for each post just for getting the like count. I could originally finish the job with only ONE network request, but now I have make 1+N times (number of posts in the page feed) of network requests.
I think I must be missing something. FB must have some way to get the like count embedded in the feed info. Just like the FB app or website, all posts show their like counts immediately, there is no way to make additional N times of network requests in order to get the like count for each post.
Hope someone can help. Thanks a lot in advance.
Finally, I found there is a way to get the like/comment counts for each post while pulling the feed without making further network requests:
/url/feed?fields=likes.summary(1).limit(0)
Isn't it great?
I am trying to write a program that extracts shipping container information from a specific site. I've had success with several shipping companies wbsites that use POST methods to submit searches. For these sites I have been using cURL, a PHP libary. However, this one site http://www.cma-cgm.com/eBusiness/Tracking/ has been very difficult to interact with. I have tried using cURL but all I retrieve is the surrounding html without the actual search results.
A sample container I am trying to track is CMAU1173561.
The actual tracking URL seems to be http://www.cma-cgm.com/eBusiness/Tracking/Default.aspx?ContNum=CMAU1173561&T=292012319448 where ContNum is the shipping container and T is a value constructed from current time.
I also noted the .aspx. What is the best approach for retrieving these search results programatically?
I've spent last few days trying to find a solution to solve problem below.
I have set of URLs for which I would like to request data - mainly pageviews and visits by months in specific time interval. These URL specify one web section and we would like to get statistics for this section. I'm using PHP GAPI.
I am able to construct correct filter for the URL set:
ga:pagePath==[url1]||ga:pagePath==[url2]||ga:pagePath==[url3]...
But this works for a fews URLs because request is sent via GET and there is request length limitation for GET.
At first I tried to make severeal requests for a few URLs from the whole set and after all requests (when I had data for all pages) I made sum of pageviews and visits. Than I realized that this could work for pageviews but not for visits (one particular visit could be counted in more than one response and thanks to sum it was counted muliple times).
And than i have these limitations:
I can't use regular expresion to shorten the filter. URLs of pages are badly designed (not thanks to us :) ) and the pages in a web section therefore don't have nice URL prefix like /my-section/*
I need historical data (2 years back), so it won't help to start tracking some custom variable or event for pages in particular web section from now.
So I tried to make POST request to API. I was able to get auth token, but POSTing request to get statistic data returns:
403 Forbidden
Target feed is read-only
I tried to find if there is actualy the possibility to use POST method, but had no luck finding exact info (some clues suggest that it is not possible).
Another idea could be redesigning URL to have some nice prefix to filter by regexp and somehow changing the stored URLs in GA, but I have a feeling that it's not possible either.
Does anyone have an idea how to solve this?
Thanks for any suggests :)