Giter VIP home page Giter VIP logo

atrrr's Introduction

Hi there 👋

I am a Post-Doc Researcher at Vrije Universiteit (VU) Amsterdam, working on the NEWSFLOWS project (based at the University of Amsterdam until February 2024). Until September 2023 I worked at the Department of Communication Science at Vrije Universiteit Amsterdam working on the OPTED project and AmCAT (Amsterdam Conent Analyis Toolkit. Since April, I also started to work on the NEWSFLOWS project at the Department of Communication Science at the University of Amsterdam. Previously, I worked as Post-Doc Researcher at the Chair for Digital Democracy at the European New School of Digital Studies (ENS), European University Viadrina Foundation Frankfurt (Oder). In 2021, I passed my PhD in Politics at the University of Glasgow.

  • 🔭 I’m currently working on several R packages for research and doing research on hybrid media systems and computational methods.
  • 💬 Ask me about R, text analysis and political communication

I'm present on a couple of different platforms, in case you want to reach or follow me:

Johannes's GitHub stats

atrrr's People

Contributors

benjaminguinaudeau avatar favstats avatar jbgruber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

atrrr's Issues

TODO: examples

Search skeet-endpoint + Pagination

  • Keywords-based search
  • Pagination example, how to deal with cursor?

Get profiles + follow graph

  • Take an account
  • Get description
  • Get all followers/follows
  • Get description of all followers/follows

Create a post

  • support for media

Get list of members in a feed

  • Get the list of people in the rstats feed
  • Top poster from a specific feed
  • Top popular poster from a specific feed

Get likes from a post

  • Most famous rstats post
  • Like anlaysis
  • Eventual temporal structure

Rename package

Since there was at some point a package called ATR on CRAN, the name is blocked and we can't submit the package under this name. We thus decided to rename the package to atrrr. You can easily move your old tokens to work in the new package with:

R.utils::copyDirectory(tools::R_user_dir("atr", "cache"), 
                       tools::R_user_dir("atrrr", "cache"))

Nothing else changes, except that you have to change library(atr) and atr:: call to the new atrrr.

Parse Markdown links

Would be cool if people could use Markdown syntax like [test](https://github.com/JBGruber/atr) to add custom link texts to links.

get_user_info needs pagination

It looks like there is a limit how many actors can go into the get_user_info function. Below 26 is fine, but then:

library(atrrr)
df <- search_post("Amsterdam", limit = 200)
#> ℹ Found an *unknown total* of posts that fit the query
#> ⠙ Got 97 posts, but there is more.. [1.2s]
#> ⠹ Got 192 posts, but there is more.. [1.6s]
#> ⠸ Got 285 posts, but there is more.. [1.9s]
#> ℹ Parsing 285 results.
#> ✔ Got 285 results. All done!
#> 
user_info <- get_user_info(actor = df$author_handle)
#> Error in `httr2::req_perform()` at atrrr/R/utils.r:57:5:
#> ! HTTP 400 Bad Request.
#> • error type: InvalidRequest
#> • message: Error: actors must not have more than 25 elements

Created on 2024-02-13 with reprex v2.1.0

We should fix this, since we take care of pagination elsewhere (e.g., in search_post). So why not here.

Release on CRAN

Once #1 and #2 are done (maybe they are already done, I haven't checked all todos), we should aim to push this to CRAN. From my experience, any tests make it rather harder to pass CRAN checks, so I probably wouldn't bother finishing #3 just now. So what's left to do is:

  • resolve note about the regexs data. I think it would make more sense to have the regular expressions as internal data anyway, but I wasn't aware that option existed at the time
  • we should take another stab at pre-computing the vignettes (see this) otherwise cran tests will get mad
  • CRAN has a weird policy that tests are not allowed to leave behind any files outside the package directory, except in tempdir. This includes rendering the examples, readme and vignettes. We need to check if anything produces a file (auth() does for sure).

Anything else?

Hashtags

Hi,

It seems that for me adding hashtags to skeets does not integrate fully into Bluesky's framework... i.e. they show up in the skeet, but do not hyperlink. Am I the only one noticing that?

Thanks, Philipp

searching for username

Not sure if this is an actual issue or user error. I can only find my handle when I add .bsky.social

library(atr)
search_user("schochastics")
#> ℹ Parsing 0 results.
#> ✔ Got 0 results. All done!
#> 
#> # A tibble: 0 × 0
search_user("schochastics.bsky.social")
#> ℹ Parsing 1 results.
#> ✔ Got 1 results. All done!
#> 
#> # A tibble: 1 × 8
#>   did             handle display_name description avatar indexed_at viewer_muted
#>   <chr>           <chr>  <chr>        <chr>       <chr>  <chr>      <lgl>       
#> 1 did:plc:sv2aev… schoc… David Schoch "Team Lead… https… 2023-11-0… FALSE       
#> # ℹ 1 more variable: viewer_blocked_by <lgl>

Created on 2023-11-10 with reprex v2.0.2

Initial user facing functions

I would suggest to implement these user-facing functions first:

function endpoint status
search_skeet (aka search_post) app/bsky/feed/searchPosts.json ❌ does not work/exist
search_user app/bsky/actor/searchActors.json
get_user_info app/bsky/actor/getProfile.json
get_followers app/bsky/graph/getFollowers.json
get_follows app/bsky/graph/getFollows.json
get_skeets_authored_by app/bsky/feed/getAuthorFeed.json
get_own_timeline app/bsky/feed/getTimeline.json
follow_user app/bsky/graph/follow.json
unfollow_user app/bsky/graph/follow.json
post_skeet app/bsky/feed/post.json
delete_skeet app/bsky/feed/post.json
get_reposts app/bsky/feed/getRepostedBy.json
get_skeet_likes app/bsky/feed/getLikes.json
get_feed_likes app/bsky/feed/getLikes.json
get_feeds_created_by app.bsky.feed.getActorFeeds.json
get_feed app.bsky.feed.getFeed.json
add_feed ?
remove_feed ?
feed_following ?
get_own_user_suggestions app.bsky.actor.getSuggestions.json
get_own_likes app.bsky.feed.getActorLikes.json
get_own_feed_suggestions app.bsky.feed.getSuggestedFeeds.json
get_own_blocking app.bsky.graph.getBlocks.json
get_own_preferences app.bsky.actor.getPreferences.json
get_user_suggestions_for app.bsky.graph.getSuggestedFollowsByActor.json

Un/follow functions might all need to use follow.json, not sure. Couldn't find the endpoint to look up feed followers.

"Unknown or uninitialized column" warning

Running into issues on a virtual Windows server with R (4.1.3). The atr package installs without issues, and authentication works fine. Retrieving skeets yields the expected results (e.g. your example feeds <- get_feeds_created_by(actor = "andrew.heiss.phd" works without errors).

But, I’m running into an issue when posting:

Error Message

Although the response claims that the message was posted, it never shows up on the feed.

If helpful, here’s the output from sessionInfo:

sessionInfo

Wrong or missing TZ or confused UTC setting?

Given that the posts at your end 'react' to mine, they cannot possibly have happened six hours earlier:

image

Is a simpler explanation that maybe the timestamp is a mix of UTC and a TZ? Why would my desktop here in the America/Central timezone show a difference of six hours (especially given that Amsterdam to Chicago should be seven hours). On the other hand, UTC is six hours from me. Maybe (and I am just guessing here, based on many scars from fighting similar problems on the parsing and formatting side) you format it such that it seen as UTC but does properly account for current UTC?

Add tests

Tests are a little tricky. As the protocol might change rapidly, it does not make much sense to mock server replies. Some of the endpoints also don't behave exactly like advertised, so testing them against the described output might be a pain for now. I would suggest to only test the exported functions against the API and the auto-generated ones against the reply defined in the lexicon. We won't learn a lot from the latter, but at least all the code is covered and we can play around with the generator without causing issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.