# How to retrieve Topics/Topics List, Replies from Activity Tab using Ruby?

**URL:** https://meta.discourse.org/t/how-to-retrieve-topics-topics-list-replies-from-activity-tab-using-ruby/313529
**Category:** Development
**Created:** [June 25, 2024, 10:10am UTC](https://meta.discourse.org/t/how-to-retrieve-topics-topics-list-replies-from-activity-tab-using-ruby/313529 "2024-06-25T10:10:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![omppatil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omppatil/32/359876_2.png) [@omppatil](https://meta.discourse.org/u/omppatil)
#### Post date: [June 25, 2024, 10:10am UTC](https://meta.discourse.org/t/how-to-retrieve-topics-topics-list-replies-from-activity-tab-using-ruby/313529/1 "2024-06-25T10:10:18Z")

</div>

Hi!,  
Is there any way we can retrieve Topics/Topics List ,Replies From Activity Tab using Ruby?  
Any help would be appreciated.  
Image 1 : (Non admin User)

 ![Screenshot_2024-06-25_at_3_29_13_PM](https://global.discourse-cdn.com/meta/original/4X/3/5/6/3568d3f4e081a0a2c60b3545324707f65fbd56a3.jpeg)  
Image 2 : (Admin User)  
 ![Screenshot_2024-06-25_at_3_29_25_PM](https://global.discourse-cdn.com/meta/original/4X/f/e/a/feaebc6b2176fcedc5b08a12e42219375ab4c2b1.jpeg)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 25, 2024, 1:29pm UTC](https://meta.discourse.org/t/how-to-retrieve-topics-topics-list-replies-from-activity-tab-using-ruby/313529/2 "2024-06-25T13:29:45Z")

</div>

What problem are you trying to solve?

You want to get the posts from a particular user?

```plaintext
./launcher enter app
rails c
u = User.find_by_username("pat")
posts=Post.where(user_id: u.id)

```

You can get them with the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin.

---

<div class="post-metadata">

### Author: ![omppatil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omppatil/32/359876_2.png) [@omppatil](https://meta.discourse.org/u/omppatil)
#### Post date: [June 26, 2024, 5:42am UTC](https://meta.discourse.org/t/how-to-retrieve-topics-topics-list-replies-from-activity-tab-using-ruby/313529/3 "2024-06-26T05:42:57Z")

</div>

![Screenshot_2024-06-26_at_11_00_38_AM](https://global.discourse-cdn.com/meta/original/4X/5/8/9/589ece358ba3510723bc7082ab52c52cce0fae32.jpeg)  
When we click on a user’s avatar, we are directed to that user’s activity page, where we can see the topics and posts in which that user has participated. I want to retrieve these topics along with the posts from the Activity tab using Ruby.  
Is there any event where I can achieve this?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 26, 2024, 11:19am UTC](https://meta.discourse.org/t/how-to-retrieve-topics-topics-list-replies-from-activity-tab-using-ruby/313529/4 "2024-06-26T11:19:41Z")

</div>

Did you try the code that I supplied?

Why do you want to retrieve the information with ruby?

---

<div class="post-metadata">

### Author: ![omppatil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omppatil/32/359876_2.png) [@omppatil](https://meta.discourse.org/u/omppatil)
#### Post date: [June 27, 2024, 11:21am UTC](https://meta.discourse.org/t/how-to-retrieve-topics-topics-list-replies-from-activity-tab-using-ruby/313529/5 "2024-06-27T11:21:24Z")

</div>

Yes, I tried the code, and it works. I’m attempting to retrieve the posts under an event that accesses the Activity tab

> [@omppatil](#):
>
> When we click on a user’s avatar, we are directed to that user’s activity page, where we can see the topics and posts in which that user has participated. I want to retrieve these topics along with the posts from the Activity tab using Ruby.

I think using the function **post\_query** in the **UserSummary** class can help me achieve this. Please correct me if I’m wrong.

> [@pfaffman](#):
>
> Why do you want to retrieve the information with ruby?

I want to use Ruby because I think it allows me to modify my data quickly, unlike JavaScript, which lags and takes time to load pages,Please correct me if I’m wrong.
