Unable to get Events with specific location using restFB - java

I am unable to fetch all sports events happening in the state of
Georgia. Is this the right way to use this, since its currently
retrieving all events across the country.
FacebookClient publicFbClient = new DefaultFacebookClient();
Connection<Event> events = publicFbClient.fetchConnection(
"search", Event.class,
Parameter.with("category", "Sports"),
Parameter.with("location", "Georgia"),
Parameter.with("type", "event"));

There's no mention in the doc of the ability to limit results geographically except center (latlong) and distance (radius) when the type place is defined.
You can set the radial search variables for events but doing so doesn't appear to change the results.

Related

Leaflet search options for multiple markers

I have a leaflet project with around 150 points that should be displayed. The idea is to show the progress of a project, therefore there are 257 symbols which could be assigned to a point. And there is also a pop up which display additional infos.
The "database" is an excel sheet which gets updated regularly. So I have a python script which updates my leaflet script. This part is running fine and does what it should.
Current code
var map = L.map('map').setView([47.0, 9.0], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© OpenStreetMap contributors'
}).addTo(map);
// show the scale bar on the lower left corner
L.control.scale({imperial: false, metric: true}).addTo(map);
var symb_A2_22_1 = L.icon({
iconUrl: 'folder/KB-11.png',
iconSize: [42, 20]
});
var A2_22_1 = L.marker([47.4678,8.7049],{icon: symb_A2_22_1}).addTo(map)
A2_22_1.bindPopup("<b>A2-22-1</b><br>x<br>PWD<br>x<br>x")
var symb_A2_22_100 = L.icon({
iconUrl: 'folder/RS-11.png',
iconSize: [42, 20]
});
var A2_22_100 = L.marker([47.4708,8.7059],{icon: symb_A2_22_100}).addTo(map)
A2_22_100.bindPopup("<b>A2-22-100</b><br>x<br>PWD<br>x<br>x)
Now I want to add a search option to search by the name of the point. I already searched for solutions. I think I have to bring all my points into one layer. So the here (Putting multiple markers in Layer Group )presented solution seems to be a good idea (create markers, add to layer, and then add the layer to the map and not the single markers).
However how I get the popup content and my custom symbol into the list?
Or do you have another solution to make my markers searchable?

How to list Streams owned by a Project Area using Jazz RTC Java API

I am working an automation for IBM Rational Team Concert (IBM aka Jazz RTC).
How may one list all streams owned by a specific project area?
Which are the required API calls?
I could not find any getters in the IProjectArea instance, nor service or client instances with such methods. And I could not figure out how to use search criteria for this purpose.
The streams owned by a project area may be queried using IWorkspaceSearchCriteria. Because streams are, actually, workspaces of type 'stream'. The API is not quite clear how to specify the owning project area.
Get the IWorkspaceManager from the ITeamRepository, which contains the findWorkspaces method.
You don't need IProjectAreaHandle. Only the project area name.
Create a IWorkspaceSearchCriteria and set kind to IWorkspaceSearchCriteria.STREAMS and set exactOwnerName to the string containing the project area name.
Call IWorkspaceManager.findWorkspaces(...) to get a list of IWorkspaceHandles. The first parameter is the search criteria. Se second parameter is the maximum number of results (which I set to IWorkspaceManager.MAX_QUERY_SIZE, which is 512. The third parameter is the progress monitor, which may be null.
If you need to get stream name, description or other attributes, then you need to call IItemManager.fetchCompleteItems(...) fetch the full IWorkspace instances.
Here is an example in Groovy:
Lit<IComponentHandle> listComponents(String projectAreaName) {
final manager = repositoty.getClientLibrary(IWorkspaceManager) as IWorkspaceManager;
final criteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
criteria.setKind(IWorkspaceSearchCriteria.STREAMS);
criteria.setExactOwnerName(projectAreaName)
final itemManager = repositoty.itemManager()
return itemManager.fetchCompleteItems(handles, IItemManager.DEFAULT, null) as List<IWorkspace>
}

Is there a way to know what options and properties are available to use when querying for calendar events with the Graph API?

This may be a dumb question, but I'm kind of stuck when trying to figure out what options I have available when querying for calendar events using Microsoft's Java Graph API.
In their tutorial they have the following code example.
public static List<Event> getEvents(String accessToken) {
ensureGraphClient(accessToken);
// Use QueryOption to specify the $orderby query parameter
final List<Option> options = new LinkedList<Option>();
// Sort results by createdDateTime, get newest first
options.add(new QueryOption("orderby", "createdDateTime DESC"));
// GET /me/events
IEventCollectionPage eventPage = graphClient
.me()
.events()
.buildRequest(options)
.select("subject,organizer,start,end")
.get();
return eventPage.getCurrentPage();
}
They are using the orderby option and telling it to use createdDateTime DESC ordering. Is there a list of other options and their possible values somewhere? For example, what option would I use if I only wanted events from 2020-10-01 to 2020-10-31?
My second question is regarding the properties that they're selecting (subject, organizer, start, end). Is there also a list of possible properties that can be selected for each event?
You can see all the properties in the event resource type. You can see the ODATA query options here. You can use filter query parameter that can filter the data. But remember that some properties/endpoints support them and some may not.

Simple GET request with Facebooks API

I am currently taking a course in app development and I am trying to use Facebooks API for GET requests on certain events. My goal is the get a JSON file containing all comments made on a certain event.
However some events return only a an "id" key with an id number such as this:
{
"id": "116445769058883"
}
That happends with this event:
https://www.facebook.com/events/116445769058883/
However other events such as (https://www.facebook.com/events/1964003870536124/) : returns only the latest comment for some reason.
I am experementing with facebook explore API:
https://developers.facebook.com/tools/explorer/
This is the following GET requests that I have been using in the explorer:
GET -> /v.10/facebook-id/?fields=comments
Any ideas? It's really tricky to understand the response since both events have the privacy set to OPEN.
Starting from v2.4 of the API, the API is now declarative which means you'll need to specify what fields you want the API to return.
For example, if you want first name and second name of the user, then you make a GET request to /me?fields=first_name,last_name else you will only get back the default fields which are id and name.
If you want to see what fields are available for a given endpoint, use metadata field. e.g. GET /me?metadata=true

box-api search parameters not working?

I'm using the Java SDK to connect to Box. I find the root folder (this is a small dev instance so I don't mind searching from there.) I execute the search query and I get results. My problem is that the search parameters do not seem to work consistently or at all.
For example, this query
Iterator resultSet = rootFolder.search("query=NR_chewy_chic_swt_pot_app&file_extensions=jpg&content_type=name&type=file").iterator();
returns three entries.
NR_chewy_chic_swt_pot_app.jpg
NR Chewy Chicken AD02.xls
PreInvoice_M197301-3644756_NR Chewy Treats SURP.pdf
I remove the substring "&file_extensions=jpg" because it doesn't seem to do anything and save/recompile/run and I get the same three results.
I change "&type=file" to "&type=folder" and I get the same three results.
I change "query=NR_chewy_chic_swt_pot_app" to "query=NR" and I get NO results. Even though SO user Peter (who appears to work for Box) says that partial strings should match1.
I've tried rearranging the order of the search parameters to no avail. What am I missing?
Thanks,
Eric B.
Advanced search has yet to be implemented in the SDK (since it's still in beta), but it will be added in the coming weeks.
The reason why your call doesn't work is because the query method parameter is sent as the "query" URL parameter in the API call. Therefore, the ampersands in your query string are being escaped.
If you need an immediate workaround, you can use the BoxAPIRequest and BoxAPIResponse classes to make a custom search request. For example:
BoxAPIConnection api = new BoxAPIConnection("token");
URL url = new URL("https://api.box.com/2.0/search?query=NR_chewy_chic_swt_pot_app&file_extensions=jpg&content_type=name&type=file")
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
String json = response.getJSON();
Sorry that this wasn't clear. We'll update the documentation to make it more explicit that query represents the query field and not the URL query string.

Categories

Resources