baedert / corebird

Native Gtk+ Twitter Client
https://corebird.baedert.org
GNU General Public License v3.0
789 stars 78 forks source link

Add a way to request that Corebird display a specific tweet #320

Open catern opened 9 years ago

catern commented 9 years ago

I would envision this as being a DBUS method, OpenTweet, which takes a string that is the tweet ID. Maybe there would also be OpenUser which would open the page given a specific user.

As a further enhancement, perhaps there could be an OpenURL method which would take a string that is a URL to twitter.com, figure out what the URL points to (a tweet or a user page), and show that thing. This logic might be shared with other components in Corebird?

Use cases:

baedert commented 9 years ago

I have a test of this in the dbus branch now, but using a show-profile action and e.g.

gdbus call --session --dest org.baedert.corebird --object-path /org/baedert/corebird --method org.gtk.Actions.Activate 'show-profile' "[<@x 118055879>]" "{}"

Seems to work.

catern commented 9 years ago

That works great! But wouldn't it be better to expose a method that takes a Twitter screen name rather than a Twitter ID? To go from a screen name to an ID takes Twitter API stuff that Corebird already implements, right? And in most cases, if an external application wants to show a profile, and they aren't capable of displaying it themselves, they will have a string that is a Twitter screen name, rather than a Twitter ID.

baedert commented 9 years ago

Yeah, the id here is really just because we use a id in ProfilePage. Since profile URLs use the users's handle, we should probably just use that for profiles, and the tweet id when showing tweets.

baedert commented 9 years ago

Oh, I changed the type of the action to a string and it now takes the screen_name, btw. It gets a bit ugly in ProfilePage because of the screen_name/id duality (but it's not like it was beautiful before...).

khurshid-alam commented 7 years ago

@baedert

1.

Oh, I changed the type of the action to a string and it now takes the screen_name

screen_name as Twitter user name? Can you give an example. I tried with d-feet, but it is not working may be because i am not constructing it properly.

  1. gdbus call --session --dest org.baedert.corebird --object-path /org/baedert/corebird --method org.gtk.Actions.Activate 'show-profile' "[<@x 118055879>]" "{}"

What are other gtk.actions other than 'show-profile'?

baedert commented 7 years ago

It's all just in the dbus branch which I haven't touched in ages.