thesameguyorg / nextjs-boilerplate

https://nextjs-boilerplate-azure-nine-59.vercel.app
0 stars 0 forks source link

sweep: this is the boilerplate of nextjs 14 i want to show the models from this api to my nextjs website #1

Open Hardeepex opened 8 months ago

Hardeepex commented 8 months ago

curl 'https://onlysearch.co/api/search?keyword=&location=&sortBy=&priceFrom=0&priceTo=50&page=1' \ -H 'authority: onlysearch.co' \ -H 'accept: /' \ -H 'accept-language: en-US,en;q=0.9' \ -H 'cache-control: no-cache' \ -H 'cookie: ajs_anonymous_id=73b367a2-d04b-4f76-b8ee-3e7febc3678e' \ -H 'pragma: no-cache' \ -H 'referer: https://onlysearch.co/profiles?keyword=' \ -H 'sec-ch-ua: "Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"' \ -H 'sec-ch-ua-mobile: ?1' \ -H 'sec-ch-ua-platform: "Android"' \ -H 'sec-fetch-dest: empty' \ -H 'sec-fetch-mode: cors' \ -H 'sec-fetch-site: same-origin' \ -H 'user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36' \ --compressed

Checklist - [X] Create `app/api.ts` ✓ https://github.com/thesameguyorg/nextjs-boilerplate/commit/fd3a893513df0c2da755d92333c5d3a18af5f508 [Edit](https://github.com/thesameguyorg/nextjs-boilerplate/edit/sweep/this_is_the_boilerplate_of_nextjs_14_i_w/app/api.ts) - [X] Running GitHub Actions for `app/api.ts` ✓ [Edit](https://github.com/thesameguyorg/nextjs-boilerplate/edit/sweep/this_is_the_boilerplate_of_nextjs_14_i_w/app/api.ts) - [X] Modify `app/page.tsx` ✓ https://github.com/thesameguyorg/nextjs-boilerplate/commit/20eec31b8bb8de22d33a763721d921edf7de6301 [Edit](https://github.com/thesameguyorg/nextjs-boilerplate/edit/sweep/this_is_the_boilerplate_of_nextjs_14_i_w/app/page.tsx) - [X] Running GitHub Actions for `app/page.tsx` ✓ [Edit](https://github.com/thesameguyorg/nextjs-boilerplate/edit/sweep/this_is_the_boilerplate_of_nextjs_14_i_w/app/page.tsx)
sweep-ai[bot] commented 8 months ago

🚀 Here's the PR! #3

See Sweep's progress at the progress dashboard!
Sweep Basic Tier: I'm using GPT-4. You have 5 GPT-4 tickets left for the month and 3 for the day. (tracking ID: 73c077ce3c)

For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets).
Install Sweep Configs: Pull Request

Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for 5577553
Checking app/page.tsx for syntax errors... ✅ app/page.tsx has no syntax errors! 1/1 ✓
Checking app/page.tsx for syntax errors...
✅ app/page.tsx has no syntax errors!

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/thesameguyorg/nextjs-boilerplate/blob/557755384aa470e0760d19f15403a9e664b47993/README.md#L1-L34 https://github.com/thesameguyorg/nextjs-boilerplate/blob/557755384aa470e0760d19f15403a9e664b47993/app/layout.tsx#L1-L21 https://github.com/thesameguyorg/nextjs-boilerplate/blob/557755384aa470e0760d19f15403a9e664b47993/app/page.tsx#L1-L112
I also found the following external resources that might be helpful: **Summaries of links found in the content:** https://onlysearch.co/profiles?keyword: The page metadata indicates that the page is titled "OnlySearch — Search OnlyFans profiles" and it is related to searching for OnlyFans profiles using keywords. The page is from the website OnlySearch and the URL is "onlysearch.co/profiles". The og:description states that OnlySearch is the easiest way to search for OnlyFans profiles using keywords and it claims to have over 100,000 profiles, making it the largest OnlyFans search engine. The content of the page includes information about signing in, adding a profile, searching, location, price, paid promotion, how search works, privacy, and terms. The provided code snippet is a cURL command that is making a GET request to the URL "https://onlysearch.co/api/search" with specific parameters such as keyword, location, sortBy, priceFrom, priceTo, and page. The request includes various headers such as authority, accept, accept-language, cache-control, cookie, pragma, referer, sec-ch-ua, sec-ch-ua-mobile, sec-ch-ua-platform, sec-fetch-dest, sec-fetch-mode, sec-fetch-site, and user-agent. https://onlysearch.co/api/search?keyword=&location=&sortBy=&priceFrom=0&priceTo=50&page=1: The page contains metadata for various profiles on OnlyFans. Each profile has information such as the profile picture, header photo, display name, bio, location, website, social media links, join date, verification status, subscription price, number of subscribers, number of likes, number of photos, and number of videos. The metadata also includes the object ID and slug for each profile. The page does not have a title.

I also found some related docs:

Summary of related docs from https://nextjs.org/docs:

To show the models from the API on your Next.js website, you can make a GET request to the URL "https://onlysearch.co/api/search" with specific parameters such as keyword, location, sortBy, priceFrom, priceTo, and page. The provided cURL command can be used as a starting point for making the request. The response from the API will contain metadata for various profiles on OnlyFans, including information such as profile picture, display name, bio, location, subscription price, number of subscribers, and more. You can use this data to display the models on your website.

Sources:


Step 2: ⌨️ Coding

Ran GitHub Actions for fd3a893513df0c2da755d92333c5d3a18af5f508:
• Vercel Preview Comments:

--- 
+++ 
@@ -1,8 +1,37 @@
 import Image from 'next/image'
+import { fetchProfiles } from 'app/api.ts';
+
+import { useState, useEffect } from 'react';

 export default function Home() {
+  const [profiles, setProfiles] = useState(null);
+  const [error, setError] = useState('');
+
+  useEffect(() => {
+    fetchProfiles()
+      .then(data => setProfiles(data))
+      .catch(error => setError(error.message));
+  }, []);
   return (
     
+ {error &&

Error: {error}

} + {!error && profiles && ( +
+ {profiles.map((profile) => ( +
+ {/* You can style your profile cards here */} + {profile.name} +
+
{profile.name}
+

+ {profile.description} +

+ {/* More profile data here */} +
+
+ ))} +
+ )}

Get started by editing 

Ran GitHub Actions for 20eec31b8bb8de22d33a763721d921edf7de6301:
• Vercel Preview Comments:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/this_is_the_boilerplate_of_nextjs_14_i_w.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord