spring-social-linkedin only retrieved two current positions and no past positions - spring-social

I'm using spring-social-linkedin 1.0.1.RELEASE and when I iterate through positions after calling:
.getUserProfileFull().getPositions()
it only returns up to two current positions and no past positions.
Is there a way to configure it to bring back all past and present positions?

Per LinkedIn's API documentation at https://developer.linkedin.com/documents/profile-fields, "Only current positions are available for people other than the authenticated member." There doesn't appear to be any way to configure it otherwise.

Related

Autocomplete v Nearby Search?

I am building an app that will require extensive use of the autocomplete function and have currently implemented under Nearby Search. I recently learned however that this is the priciest option given its high cost + associated Contact and Atmospheric data imposed costs.
I am therefore looking for a good option to get relevant autocomplete search results based on the users location without the need for 'Nearby search'. I care about the UX and thus want to avoid people scrolling too much to find a place near them. The only field I need is name & potentially address.
I tried Nearby search, if I understand correctly this is the only way to get autocomplete predictions based on where you physically are located - I have now learned that this is too expensive however
Autocomplete and Nearby Search are entirely different operations and APIs, you can combine both to build a user-friendly experience but they each play a very different role.
Place Autocomplete provide predictions of places based on the user's input, i.e. characters the enter into an input field. These predictions can be biased, even restricted, to a small area around the user's location, to increase the chances that they will represent places near to the user. Depending on whether places far away from the user are acceptable or useful, or not, you can use one or the other:
locationbias if predictions far away are acceptable and useful, e.g. a user searching for a place that is not necessaraly where they are, or in situations where the user location is either not available or not very precise, e.g.
user wants to find a place to go to
user location is obtained from geolocating their IP address
user location is obtained from geolocating their cell towers
locationrestriction if only very nearby predictions are acceptable and user location is known to be very precise (e.g. GPS or other high-precision sources). This would make sense in mobile applications when the user location is provided (by the phone's OS) with a small radius (e.g. under 100 m.) and the user really just wants to find places that describe where they are now. Even then, beware that some places can be bigger than you'd expect, e.g. airports include runways.
Note on billing: Place Autocomplete can be free under specific conditions: when your application implements session tokens and there is a Place Details request at the end of the session, in which case Place Details is billed and Autocomplete is not. However, even if your application implements session tokens, each time a user doesn't pick a prediction, Autocomplete is billed as a session without Details. And in the simpler case, if your application does not implement session tokens, all Autocomplete is billed as per-request (and Place Details is billed separately, on top of that).
Nearby Search can provide nearby places (and can rankby=distance) based on only the user's location and without user's input. This can be used to show an initial list of places (e.g. the nearest 5 places) even before the user starts typing. There a few caveats:
results depends heavily on the user location being very precise
results will only include establishment places, i.e. business, parks, transit stations
If you'd want addresses instead of businesses, you could use reverse geocoding instead of Nearby Search, with the caveat that this can return results that are near/ish and don't necessarily represent the exact place where the user is at. This is more useful when you want to find addresses around a location; they may include the actual address of that location, but that is not guaranted.

How to go down (recursively) in UIPath

I want to go down recursively and automatically at the host and clusters tab (the blue one in the picture), and then take the text like guest os, compability, etc.
I already know how to get the text from summary, but I got the problem to loop (go down) at the host and cluster tabs.
Any idea how to do it?
Thank you very much.
It's probably not the best idea to have one robot do everything - i.e. setting filters, parsing results, clicking on each result, parsing data, then going back, and so on. Instead of that approach, divide and conquer. Create multiple sequences/workflows, each one with one specific task in mind.
Here's how I would tackle it:
Create a sequence that opens the target page, setting the filters (e.g. Germany, as mentioned in your link: https://www.autoscout24.de/ergebnisse?cy=D&powertype=kw&atype=C&ustate=N%2CU&sort=standard&desc=0&page=1&size=20)
Have the same robot extract the link for each result. Don't go into the details, this could potentially be the task of another robot.
Have the links stored in a queue. Read more about Queues and Transactions here.
Create another sequence that takes the next item in the queue and open the stored link. This will take you directly to the results page (e.g. https://www.autoscout24.de/angebote/opel-corsa-12v-city-servo-ahk-benzin-silber-84a66193-b6d6-4fc9-b222-ec5a7319f221?cldtidx=1)
Parse any kind of data you need.
This comes with the benefit that you can use multiple robots at the same time extracting data, potentially increasing scraping significantly. The Queues and Transactions feature will make sure each result is visited only once, and that multiple robots don't process the same item multiple times.
Edit: you might want to start with ReFramework, which I'd recommend.

Get all postcodes on a given location using any Google API

Is it possible to get all postal codes in a given location inside the given radius?
What Google API should I use?
Example: I have a lat. and a long. and my radius is 15kms. How do I get the post codes of the areas inside the radius?
I'm kinda new to using API's and Google API's.
Thanks!
This is a process called "Reverse Geocoding" Google offers it here - https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse
However pretty sure that Google's API will try to give you one closest result rather than many.
You can do this with APIs (often paid for) however, be warned that you have to be quite careful with the radius element, setting it too small in rural areas will bring back 0 results and setting it too big in urban areas will bring back potentially thousands.

Order posts by number manually entered by the user

I have a website which its admin user logs into a restricted area and adds content that is displayed on the public area. The admin wants a simple input text field on the post insert/edit form where he can type a number that determines in which position that post will be displayed to the public.
So, if the “Foo” post is given the number 3, it should be listed in the 3rd position, the old post 3 should become 4, 4 should become 5, and so on. If post 5 is repositioned to 1, 1 should automatically become 2, 2 should become 3, etc. If the admin reposition, 3 to 2, 2 should just become 3 without the need to change the other ones. If 10 becomes 9, 9 becomes 10 and no need to change other posts' position either. In short, when the position of one single post is changed (or inserted in the middle of existing posts), the remaining posts should have their position shifted accordingly.
I have considered two possibilities:
create a crazy algorithm that selects each post needed and updates the position column;
implement a linked list in the table so that each post always knows what is the primary key of the next one.
With the first option, when the admin inserts or updates a post's position, all the work is done at that moment, and when the public site is visited, the SQL just selects all the needed posts in a single query and order them by position. I don't really know yet how I would implement it, but I'm sure using a lot of code and possibly bad trade-offs it would be possible.
With the second option, there is much less work done during the insert/update, but when users access the site, I need to do one select for each post so that the right positioning can be achieved using the each post's link to the next “node”. So, if I have 150 posts in a given category, I'll have to run 150 selects (one for each post that is pointed to by the current "node". No pagination will be used in this case, and only the titles will be really listed, one below the other, so, I will really list them all.
I would like suggestions to other approaches, insights or improvements on the two possibilities I have described.
SOLUTION
I accepted #FractlizeR answer because it uses some other established piece of software to support his choice.
I wrote a small prototype on the solution I ended up using at work. Of course the code I used at work is different because I was changing a legacy system. Still, I used exactly the same SQL approach as the ones in the prototype. I hope I can improve that prototype and specially its comments soon, but at least it is there in case I or someone else needs to do something similar.
I would vote for #1. This is what, for example, XenForo forum engine does. It uses post position for paging and other things. When it needs to insert a new post into a thread, it queries thread for all posts, that needs to be reordered, then for each post calculates a new position and then updates table for all posts, which position changed.
We use XenForo for a long time in production and actually there should be no problems involved since this operation (reorder) is not so complex.

How to remove all pins Google Maps V3?

I am currently working on a code where we have a world map. On this map, the users position (you) is marked with a white marker. And there is so called "drivers" which drive around on our globe. The drivers position is taken from an API which my friend has written. But now to the problem, when our site here grabs values from all drivers which is shown on the API, it add their position. Then after 3000 ms, it grabs values again. Which means that drivers pins adds again, again and again, over each other. That due to my loop which grabs values from our API every 3000 ms. How could I use the code I got now, and make all drivers pins to be removed 100 ms before values are grabbed from my API?
Demo: http://profusum.se/bc/map/ (Notice that the pins are getting "greener")
jsFiddle: http://goo.gl/8fQS1 (Shorted URL to "jsFiddle=zMYSw"
NOTICE
My jsFiddle may not work, if so, please comment and I will update this question.
I would recommend storing a reference to each "driver" in an array and then either call setMap(null) on each one at the start of your handleData() function, or modify your handleData() function to just update the position of each one.

Resources