
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
lgi-guide-sdk
Advanced tools
Provides a simple way to retrieve TV schedule data.
SDK contains few public classes representing API entities:
Broadcast always include video.
Entities are query builders encapsulating data retrieval functions, filtering, sorting and paging in order to provide simple API facade.
####Regions#### Always specify region before start.
LGI.Guide.config.region = 'NL';
Following regions are supported:
NL
NetherlandsIE
IrelandHU
Hungary####Basic example#### Let's look at the most basic example - getting list of broadcasts for Netherlands without any filtering or sorting:
var broadcastsData = LGI.Guide.Video.create()
.findOne(dataReceivedCallback);
Response:
[
{selfLink: Object},
{selfLink: Object},
{selfLink: Object},
{selfLink: Object}
]
Probably you are wondered with result containing only _selfLink property. This happen because it is important to minimize response size by getting only data you really need.
####Specifying fields to retrieve#### Let`s specify fields to retrieve as following:
LGI.Guide.Video.create()
.fields(LGI.Guide.Video.ID, LGI.Guide.Video.TITLE)
.findOne(dataReceivedCallback);
Response:
[
{id: "7shi89fww", title: "Oorlogsverhalen (3)", selfLink: Object},
{id: "3yaqesymo", title: "Millivres - Point of View", selfLink: Object},
{id: "5jzc9n9c1", title: "Mahabharat", selfLink: Object},
{id: "9l2i1y2sb", title: "Baggage Battles", selfLink: Object}
]
Much better! Now we have videos with IDs and titles.
####Limiting response size#### You can limit number of broadcasts or videos in response.
LGI.Guide.Broadcast.create()
.fields(LGI.Guide.Broadcast.ID, LGI.Guide.Broadcast.TITLE)
.limit(2)
.findOne(dataReceivedCallback);
####Paging and difference between findOne, findAll and findNext methods#### API supports paging and three data retrieval methods are supported:
You can set particular page size by using limit().
####Filtering#### Most advanced tool for specific data retrieval is filtering. In this example we will get only broadcasts with category equal to sports.
LGI.Guide.Broadcast.create()
.filter(LGI.Guide.Broadcast.category.isEqual('sports'))
.findAll(dataReceivedCallback);
####Sorting#### This will retrieve a page of broadcasts sorted by popularity:
LGI.Guide.Broadcast.create()
.fields(LGI.Guide.Broadcast.ID, LGI.Guide.Broadcast.TITLE)
.sort(LGI.Guide.Broadcast.POPULARITY, 'desc')
.findOne(dataReceivedCallback);
Almost all fields are sortable.
Explore JSDoc for available fields lists and more information.
Have a bug? Please create an issue on GitHub
FAQs
Kraken API client library
We found that lgi-guide-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.