cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
notUberMapComponentmain.tsx3 matches
497}, [value]);
498499const fetchPredictions = useCallback(
500debounce((input) => {
501if (input.length > 0 && autocompleteService.current) {
506setPredictions(results);
507} else {
508console.error("Error fetching place predictions:", status);
509setPredictions([]);
510}
521const newValue = e.target.value;
522setInputValue(newValue);
523fetchPredictions(newValue);
524if (newValue === "") {
525onChange("");
getLatestGitHubRunmain.tsx1 match
1213try {
14const actionsRunResponse = await fetch(github_api_url);
15const data = await actionsRunResponse.json();
16console.log(data);
githubRepoDailyEmailDigestmain.tsx4 matches
14};
1516// Fetch issues
17const issuesResponse = await fetch(
18`https://api.github.com/repos/${owner}/${repo}/issues?since=${twentyFourHoursAgo}&state=all`,
19{ headers },
20);
21const issues = await issuesResponse.json();
22// Fetch PRs
23const prsResponse = await fetch(
24`https://api.github.com/repos/${owner}/${repo}/pulls?state=all&since=${twentyFourHoursAgo}`,
25{ headers },
54setAgent(newAgent);
55saveSession(newAgent.session);
56await fetchProfile(newAgent);
57await fetchTimeline(newAgent);
58await fetchTrendingTopics(newAgent);
59} catch (error) {
60console.error("Login failed:", error);
78};
7980const fetchProfile = async (currentAgent: AtpAgent, handle?: string) => {
81try {
82const { data } = await currentAgent.getProfile({ actor: handle || currentAgent.session?.did });
83if (handle) {
84setViewingProfile(data);
85await fetchUserPosts(currentAgent, data.did);
86} else {
87setProfile(data);
88}
89} catch (error) {
90console.error("Failed to fetch profile:", error);
91setError("Failed to fetch profile. Please try again.");
92}
93};
9495const fetchTimeline = async (currentAgent: AtpAgent, append = false) => {
96setLoading(true);
97setError("");
101setCursor(response.data.cursor);
102} catch (error) {
103console.error("Failed to fetch timeline:", error);
104setError("Failed to load posts. Please try again later.");
105} finally {
128setNewPost("");
129setReplyingTo(null);
130await fetchTimeline(agent);
131} catch (error) {
132console.error("Failed to create post:", error);
141try {
142await agent.like(uri, cid);
143await fetchTimeline(agent);
144} catch (error) {
145console.error("Failed to like post:", error);
152try {
153await agent.repost(uri, cid);
154await fetchTimeline(agent);
155} catch (error) {
156console.error("Failed to repost:", error);
164await agent.follow(did);
165if (viewingProfile) {
166await fetchProfile(agent, viewingProfile.handle);
167}
168} catch (error) {
177await agent.deleteFollow(did);
178if (viewingProfile) {
179await fetchProfile(agent, viewingProfile.handle);
180}
181} catch (error) {
200};
201202const fetchTrendingTopics = async (currentAgent: AtpAgent) => {
203try {
204const mockTrendingTopics = ["#BlueSkyDoesNotHaveATrendingTabYet", "#TryNova.dev"];
205setTrendingTopics(mockTrendingTopics);
206} catch (error) {
207console.error("Failed to fetch trending topics:", error);
208}
209};
210211const fetchUserPosts = async (currentAgent: AtpAgent, did: string) => {
212setLoading(true);
213setError("");
216setLastUserPost(response.data.feed[0] || null);
217} catch (error) {
218console.error("Failed to fetch user posts:", error);
219setError("Failed to load user posts. Please try again later.");
220} finally {
225const loadMore = useCallback(() => {
226if (agent && cursor) {
227fetchTimeline(agent, true);
228}
229}, [agent, cursor]);
236.then(() => {
237setAgent(restoredAgent);
238fetchProfile(restoredAgent);
239fetchTimeline(restoredAgent);
240fetchTrendingTopics(restoredAgent);
241})
242.catch((error: any) => {
250useEffect(() => {
251if (agent) {
252fetchTimeline(agent);
253}
254}, [agent]);
541<button
542onClick={() =>
543fetchProfile(agent, post.post.author.handle)}
544className="font-semibold text-[#0000FF] hover:underline"
545>
624<div key={user.did} className="mb-2">
625<button
626onClick={() => fetchProfile(agent, user.handle)}
627className="font-semibold text-[#0000FF] hover:underline"
628>
701});
702703self.addEventListener('fetch', (event) => {
704event.respondWith(
705caches.match(event.request).then((response) => {
706return response || fetch(event.request);
707})
708);
quaintBeigeCariboumain.tsx27 matches
54setAgent(newAgent);
55saveSession(newAgent.session);
56await fetchProfile(newAgent);
57await fetchTimeline(newAgent);
58await fetchTrendingTopics(newAgent);
59} catch (error) {
60console.error("Login failed:", error);
78};
7980const fetchProfile = async (currentAgent: AtpAgent, handle?: string) => {
81try {
82const { data } = await currentAgent.getProfile({ actor: handle || currentAgent.session?.did });
83if (handle) {
84setViewingProfile(data);
85await fetchUserPosts(currentAgent, data.did);
86} else {
87setProfile(data);
88}
89} catch (error) {
90console.error("Failed to fetch profile:", error);
91setError("Failed to fetch profile. Please try again.");
92}
93};
9495const fetchTimeline = async (currentAgent: AtpAgent, append = false) => {
96setLoading(true);
97setError("");
101setCursor(response.data.cursor);
102} catch (error) {
103console.error("Failed to fetch timeline:", error);
104setError("Failed to load posts. Please try again later.");
105} finally {
128setNewPost("");
129setReplyingTo(null);
130await fetchTimeline(agent);
131} catch (error) {
132console.error("Failed to create post:", error);
141try {
142await agent.like(uri, cid);
143await fetchTimeline(agent);
144} catch (error) {
145console.error("Failed to like post:", error);
152try {
153await agent.repost(uri, cid);
154await fetchTimeline(agent);
155} catch (error) {
156console.error("Failed to repost:", error);
164await agent.follow(did);
165if (viewingProfile) {
166await fetchProfile(agent, viewingProfile.handle);
167}
168} catch (error) {
177await agent.deleteFollow(did);
178if (viewingProfile) {
179await fetchProfile(agent, viewingProfile.handle);
180}
181} catch (error) {
200};
201202const fetchTrendingTopics = async (currentAgent: AtpAgent) => {
203try {
204const mockTrendingTopics = ["#BlueSkyDoesNotHaveATrendingTabYet", "#TryNova.dev"];
205setTrendingTopics(mockTrendingTopics);
206} catch (error) {
207console.error("Failed to fetch trending topics:", error);
208}
209};
210211const fetchUserPosts = async (currentAgent: AtpAgent, did: string) => {
212setLoading(true);
213setError("");
216setLastUserPost(response.data.feed[0] || null);
217} catch (error) {
218console.error("Failed to fetch user posts:", error);
219setError("Failed to load user posts. Please try again later.");
220} finally {
225const loadMore = useCallback(() => {
226if (agent && cursor) {
227fetchTimeline(agent, true);
228}
229}, [agent, cursor]);
236.then(() => {
237setAgent(restoredAgent);
238fetchProfile(restoredAgent);
239fetchTimeline(restoredAgent);
240fetchTrendingTopics(restoredAgent);
241})
242.catch((error: any) => {
250useEffect(() => {
251if (agent) {
252fetchTimeline(agent);
253}
254}, [agent]);
541<button
542onClick={() =>
543fetchProfile(agent, post.post.author.handle)}
544className="font-semibold text-[#0000FF] hover:underline"
545>
624<div key={user.did} className="mb-2">
625<button
626onClick={() => fetchProfile(agent, user.handle)}
627className="font-semibold text-[#0000FF] hover:underline"
628>
701});
702703self.addEventListener('fetch', (event) => {
704event.respondWith(
705caches.match(event.request).then((response) => {
706return response || fetch(event.request);
707})
708);
54setAgent(newAgent);
55saveSession(newAgent.session);
56await fetchProfile(newAgent);
57await fetchTimeline(newAgent);
58await fetchTrendingTopics(newAgent);
59} catch (error) {
60console.error("Login failed:", error);
78};
7980const fetchProfile = async (currentAgent: AtpAgent, handle?: string) => {
81try {
82const { data } = await currentAgent.getProfile({ actor: handle || currentAgent.session?.did });
83if (handle) {
84setViewingProfile(data);
85await fetchUserPosts(currentAgent, data.did);
86} else {
87setProfile(data);
88}
89} catch (error) {
90console.error("Failed to fetch profile:", error);
91setError("Failed to fetch profile. Please try again.");
92}
93};
9495const fetchTimeline = async (currentAgent: AtpAgent, append = false) => {
96setLoading(true);
97setError("");
101setCursor(response.data.cursor);
102} catch (error) {
103console.error("Failed to fetch timeline:", error);
104setError("Failed to load posts. Please try again later.");
105} finally {
128setNewPost("");
129setReplyingTo(null);
130await fetchTimeline(agent);
131} catch (error) {
132console.error("Failed to create post:", error);
141try {
142await agent.like(uri, cid);
143await fetchTimeline(agent);
144} catch (error) {
145console.error("Failed to like post:", error);
152try {
153await agent.repost(uri, cid);
154await fetchTimeline(agent);
155} catch (error) {
156console.error("Failed to repost:", error);
164await agent.follow(did);
165if (viewingProfile) {
166await fetchProfile(agent, viewingProfile.handle);
167}
168} catch (error) {
177await agent.deleteFollow(did);
178if (viewingProfile) {
179await fetchProfile(agent, viewingProfile.handle);
180}
181} catch (error) {
200};
201202const fetchTrendingTopics = async (currentAgent: AtpAgent) => {
203try {
204const mockTrendingTopics = ["#BlueSkyDoesNotHaveATrendingTabYet", "#TryNova.dev"];
205setTrendingTopics(mockTrendingTopics);
206} catch (error) {
207console.error("Failed to fetch trending topics:", error);
208}
209};
210211const fetchUserPosts = async (currentAgent: AtpAgent, did: string) => {
212setLoading(true);
213setError("");
216setLastUserPost(response.data.feed[0] || null);
217} catch (error) {
218console.error("Failed to fetch user posts:", error);
219setError("Failed to load user posts. Please try again later.");
220} finally {
225const loadMore = useCallback(() => {
226if (agent && cursor) {
227fetchTimeline(agent, true);
228}
229}, [agent, cursor]);
236.then(() => {
237setAgent(restoredAgent);
238fetchProfile(restoredAgent);
239fetchTimeline(restoredAgent);
240fetchTrendingTopics(restoredAgent);
241})
242.catch((error: any) => {
250useEffect(() => {
251if (agent) {
252fetchTimeline(agent);
253}
254}, [agent]);
541<button
542onClick={() =>
543fetchProfile(agent, post.post.author.handle)}
544className="font-semibold text-[#0000FF] hover:underline"
545>
624<div key={user.did} className="mb-2">
625<button
626onClick={() => fetchProfile(agent, user.handle)}
627className="font-semibold text-[#0000FF] hover:underline"
628>
701});
702703self.addEventListener('fetch', (event) => {
704event.respondWith(
705caches.match(event.request).then((response) => {
706return response || fetch(event.request);
707})
708);
cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
visibleCrimsonPossummain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({