Skip to content

Commit

Permalink
fix(fulltexts.md)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpomerenke committed Jul 18, 2024
1 parent 938ea5d commit 53257e1
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions frontend-observable/src/fulltexts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,28 @@

```js
import { embed, queryApi } from './components/util.js'
// const events = await queryApi('events', {
// source: 'acled',
// topic: 'climate_change',
// start_date: '2024-05-01',
// end_date: '2024-05-30'
// })
// const event_id = await view(
// Inputs.select(
// events.map(a => a.event_id),
// { label: 'event_id' }
// )
// )
const events = await queryApi('events', {
source: 'acled',
topic: 'climate_change',
start_date: '2022-12-10',
end_date: '2023-01-05'
})
const event_id = await view(
Inputs.select(
events.map(a => a.event_id),
{ label: 'event_id' }
)
)
```

```js
// const event = events.find(a => a.event_id === event_id)
// for (const k in event) {
// display(`${k}: ${event[k]}`)
// }
const event = events.find(a => a.event_id === event_id)
for (const k in event) {
display(`${k}: ${event[k]}`)
}
const fulltexts = await queryApi('fulltexts', {
media_source: 'news_online',
topic: 'climate_change',
start_date: '2024-05-01',
end_date: '2024-05-02'
event_id: event_id
})
display(Inputs.table(fulltexts))
```

0 comments on commit 53257e1

Please sign in to comment.