Skip to content

Commit

Permalink
fix(source): ScribbleHub
Browse files Browse the repository at this point in the history
  • Loading branch information
rajarsheechatterjee committed May 8, 2023
1 parent 4199789 commit 1afe254
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/screens/browse/components/SourceCard/SourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SourceCard: React.FC<Props> = ({
<View style={styles.details}>
<Text style={{ color: theme.onSurface }}>{source.sourceName}</Text>
<Text style={[{ color: theme.onSurfaceVariant }, styles.description]}>
<Text>{`${source.lang} ID: ${source.sourceId}`}</Text>
<Text>{`${source.lang} (ID: ${source.sourceId})`}</Text>
</Text>
</View>
</View>
Expand Down Expand Up @@ -75,9 +75,6 @@ const styles = StyleSheet.create({
},
description: {
fontSize: 12,
flexDirection: 'row',
justifyContent: 'space-evenly',
minWidth: '50%',
},
flexRow: {
flexDirection: 'row',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const CustomFileModal: React.FC<CustomCSSModalProps> = ({
<Text style={[styles.modalTitle, { color: theme.onSurface }]}>
{title}
</Text>
<Text style={[{ color: theme.secondary }]}>
<Text style={[{ color: theme.onSurfaceVariant }]}>
{getString('moreScreen.settingsScreen.readerSettings.cssHint')}
</Text>
<TextInput
Expand Down Expand Up @@ -126,6 +126,8 @@ const styles = StyleSheet.create({
customCSSContainer: {
height: 220,
borderRadius: 14,
marginTop: 16,
marginBottom: 8,
},
modalTitle: {
fontSize: 24,
Expand Down
11 changes: 6 additions & 5 deletions src/sources/en/scribblehub.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as cheerio from 'cheerio';
import { fetchHtml } from '@utils/fetch/fetch';
import { fetchApi, fetchHtml } from '@utils/fetch/fetch';

const sourceId = 35;
const baseUrl = 'https://www.scribblehub.com/';
Expand Down Expand Up @@ -85,13 +85,14 @@ const parseNovelAndChapters = async novelUrl => {
formData.append('pagenum', '-1');
formData.append('mypostid', novelUrl.split('-')[0]);

const data = await fetch(
'https://www.scribblehub.com/wp-admin/admin-ajax.php',
{
const data = await fetchApi({
url: 'https://www.scribblehub.com/wp-admin/admin-ajax.php',
init: {
method: 'POST',
body: formData,
},
);
sourceId,
});
const text = await data.text();

loadedCheerio = cheerio.load(text);
Expand Down

0 comments on commit 1afe254

Please sign in to comment.